src/Entity/Rubrique.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Uid\Uuid;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\RubriqueRepository;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. /**
  10.  * @ORM\Entity(repositoryClass=RubriqueRepository::class)
  11.  * @UniqueEntity(fields={"nom"}, message="Ce nom de rubrique existe déjà")
  12.  */
  13. class Rubrique
  14. {
  15.     const EVOLUTION_PROFESSIONNELLE '882dca46-f559-43d7-9eef-bbe24efdeaa3A';
  16.     const OFFRE_FORMATION 'ce63649f-d5e4-4bfe-a0db-ea382fca9678';
  17.     const TRANSMISSION_COMPETENCES '2039ede0-e6df-4ee3-9648-cf908b8a0236';
  18.     const QUALITE_VIE_TRAVAIL '2b3d9877-230b-4627-b8d9-599948d447b5';
  19.     const ACTUALITE '74ee7169-9e87-40d1-a4b0-aac601401cb4';
  20.     
  21.     /**
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $uuid;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      */
  34.     private $token;
  35.     /**
  36.      * @ORM\Column(type="string", length=255, nullable=true)
  37.      */
  38.     private $nom;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $src;
  43.     /**
  44.      * @ORM\Column(type="text", nullable=true)
  45.      */
  46.     private $alt;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, nullable=true)
  49.      */
  50.     private $title;
  51.     /**
  52.      * @ORM\Column(type="text", nullable=true)
  53.      */
  54.     private $description;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=Sousrubrique::class, mappedBy="rubrique")
  57.      */
  58.     private $sousrubriques;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $srcImg;
  63.     /**
  64.      * @ORM\Column(type="text", nullable=true)
  65.      */
  66.     private $altImg;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $titleImg;
  71.     /**
  72.      * @ORM\Column(type="string", length=255, nullable=true)
  73.      */
  74.     private $slug;
  75.     /**
  76.      * @ORM\Column(type="text", nullable=true)
  77.      */
  78.     private $intro;
  79.     /**
  80.      * @ORM\Column(type="text", nullable=true)
  81.      */
  82.     private $phrase;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, nullable=true)
  85.      */
  86.     private $titre;
  87.     /**
  88.      * @ORM\Column(type="integer", nullable=true)
  89.      */
  90.     private $listorder;
  91.     /**
  92.      * @ORM\Column(type="boolean", nullable=true)
  93.      */
  94.     private $statut false;
  95.     /**
  96.      * @ORM\Column(type="string", length=255, nullable=true)
  97.      */
  98.     private $lien;
  99.     public function __construct()
  100.     {
  101.         $this->uuid Uuid::v4();
  102.         $this->sousrubriques = new ArrayCollection();
  103.     }
  104.     public function getId(): ?int
  105.     {
  106.         return $this->id;
  107.     }
  108.     public function getUuid(): ?string
  109.     {
  110.         return $this->uuid;
  111.     }
  112.     public function setUuid(?string $uuid): self
  113.     {
  114.         $this->uuid $uuid;
  115.         return $this;
  116.     }
  117.     public function getToken(): ?string
  118.     {
  119.         return $this->token;
  120.     }
  121.     public function setToken(?string $token): self
  122.     {
  123.         $this->token $token;
  124.         return $this;
  125.     }
  126.     public function getNom(): ?string
  127.     {
  128.         return $this->nom;
  129.     }
  130.     public function setNom(?string $nom): self
  131.     {
  132.         $this->nom $nom;
  133.         return $this;
  134.     }
  135.     
  136.     public function getSrc(): ?string
  137.     {
  138.         return $this->src;
  139.     }
  140.     public function setSrc(?string $src): self
  141.     {
  142.         $this->src $src;
  143.         return $this;
  144.     }
  145.     public function getAlt(): ?string
  146.     {
  147.         return $this->alt;
  148.     }
  149.     public function setAlt(?string $alt): self
  150.     {
  151.         $this->alt $alt;
  152.         return $this;
  153.     }
  154.     public function getTitle(): ?string
  155.     {
  156.         return $this->title;
  157.     }
  158.     public function setTitle(?string $title): self
  159.     {
  160.         $this->title $title;
  161.         return $this;
  162.     }
  163.     public function getDescription(): ?string
  164.     {
  165.         return $this->description;
  166.     }
  167.     public function setDescription(?string $description): self
  168.     {
  169.         $this->description $description;
  170.         return $this;
  171.     }
  172.     /**
  173.      * @return Collection<int, Sousrubrique>
  174.      */
  175.     public function getSousrubriques(): Collection
  176.     {
  177.         return $this->sousrubriques;
  178.     }
  179.     public function addSousrubrique(Sousrubrique $sousrubrique): self
  180.     {
  181.         if (!$this->sousrubriques->contains($sousrubrique)) {
  182.             $this->sousrubriques[] = $sousrubrique;
  183.             $sousrubrique->setRubrique($this);
  184.         }
  185.         return $this;
  186.     }
  187.     public function removeSousrubrique(Sousrubrique $sousrubrique): self
  188.     {
  189.         if ($this->sousrubriques->removeElement($sousrubrique)) {
  190.             // set the owning side to null (unless already changed)
  191.             if ($sousrubrique->getRubrique() === $this) {
  192.                 $sousrubrique->setRubrique(null);
  193.             }
  194.         }
  195.         return $this;
  196.     }
  197.     public function getSrcImg(): ?string
  198.     {
  199.         return $this->srcImg;
  200.     }
  201.     public function setSrcImg(?string $srcImg): self
  202.     {
  203.         $this->srcImg $srcImg;
  204.         return $this;
  205.     }
  206.     public function getAltImg(): ?string
  207.     {
  208.         return $this->altImg;
  209.     }
  210.     public function setAltImg(?string $altImg): self
  211.     {
  212.         $this->altImg $altImg;
  213.         return $this;
  214.     }
  215.     public function getTitleImg(): ?string
  216.     {
  217.         return $this->titleImg;
  218.     }
  219.     public function setTitleImg(?string $titleImg): self
  220.     {
  221.         $this->titleImg $titleImg;
  222.         return $this;
  223.     }
  224.     public function getSlug(): ?string
  225.     {
  226.         return $this->slug;
  227.     }
  228.     public function setSlug(?string $slug): self
  229.     {
  230.         $this->slug $slug;
  231.         return $this;
  232.     }
  233.     public function getIntro(): ?string
  234.     {
  235.         return $this->intro;
  236.     }
  237.     public function setIntro(?string $intro): self
  238.     {
  239.         $this->intro $intro;
  240.         return $this;
  241.     }
  242.     public function getPhrase(): ?string
  243.     {
  244.         return $this->phrase;
  245.     }
  246.     public function setPhrase(?string $phrase): self
  247.     {
  248.         $this->phrase $phrase;
  249.         return $this;
  250.     }
  251.     public function getTitre(): ?string
  252.     {
  253.         return $this->titre;
  254.     }
  255.     public function setTitre(?string $titre): self
  256.     {
  257.         $this->titre $titre;
  258.         return $this;
  259.     }
  260.     public function getListorder(): ?int
  261.     {
  262.         return $this->listorder;
  263.     }
  264.     public function setListorder(?int $listorder): self
  265.     {
  266.         $this->listorder $listorder;
  267.         return $this;
  268.     }
  269.     public function isStatut(): ?bool
  270.     {
  271.         return $this->statut;
  272.     }
  273.     public function setStatut(?bool $statut): self
  274.     {
  275.         $this->statut $statut;
  276.         return $this;
  277.     }
  278.     public function getLien(): ?string
  279.     {
  280.         return $this->lien;
  281.     }
  282.     public function setLien(?string $lien): self
  283.     {
  284.         $this->lien $lien;
  285.         return $this;
  286.     }
  287. }