src/Entity/Souscategorie.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\SouscategorieRepository;
  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=SouscategorieRepository::class)
  11.  * @UniqueEntity(fields={"nom"}, message="Cette sous-catégorie existe déjà")
  12.  */
  13. class Souscategorie
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $uuid;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $token;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $slug;
  33.     /**
  34.      * @ORM\Column(type="boolean", nullable=true)
  35.      */
  36.     private $statut false;
  37.     /**
  38.      * @ORM\Column(type="datetime_immutable", nullable=true)
  39.      */
  40.     private $createdAt;
  41.     /**
  42.      * @ORM\Column(type="datetime", nullable=true)
  43.      */
  44.     private $updatedAt;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $nom;
  49.     /**
  50.      * @ORM\Column(type="text", nullable=true)
  51.      */
  52.     private $description;
  53.     /**
  54.      * @ORM\Column(type="integer", nullable=true)
  55.      */
  56.     private $listorder;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $src;
  61.     /**
  62.      * @ORM\Column(type="text", nullable=true)
  63.      */
  64.     private $alt;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $title;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $srcImg;
  73.     /**
  74.      * @ORM\Column(type="text", nullable=true)
  75.      */
  76.     private $altImg;
  77.     /**
  78.      * @ORM\Column(type="string", length=255, nullable=true)
  79.      */
  80.     private $titleImg;
  81.     /**
  82.      * @ORM\Column(type="text", nullable=true)
  83.      */
  84.     private $intro;
  85.     /**
  86.      * @ORM\OneToMany(targetEntity=Agora::class, mappedBy="souscategorie")
  87.      */
  88.     private $agoras;
  89.     public function __construct()
  90.     {
  91.         $this->uuid Uuid::v4();
  92.         $this->agoras = new ArrayCollection();
  93.     }
  94.     public function getId(): ?int
  95.     {
  96.         return $this->id;
  97.     }
  98.     public function getUuid(): ?string
  99.     {
  100.         return $this->uuid;
  101.     }
  102.     public function setUuid(?string $uuid): self
  103.     {
  104.         $this->uuid $uuid;
  105.         return $this;
  106.     }
  107.     public function getToken(): ?string
  108.     {
  109.         return $this->token;
  110.     }
  111.     public function setToken(?string $token): self
  112.     {
  113.         $this->token $token;
  114.         return $this;
  115.     }
  116.     public function getSlug(): ?string
  117.     {
  118.         return $this->slug;
  119.     }
  120.     public function setSlug(?string $slug): self
  121.     {
  122.         $this->slug $slug;
  123.         return $this;
  124.     }
  125.     public function isStatut(): ?bool
  126.     {
  127.         return $this->statut;
  128.     }
  129.     public function setStatut(?bool $statut): self
  130.     {
  131.         $this->statut $statut;
  132.         return $this;
  133.     }
  134.     public function getCreatedAt(): ?\DateTimeImmutable
  135.     {
  136.         return $this->createdAt;
  137.     }
  138.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  139.     {
  140.         $this->createdAt $createdAt;
  141.         return $this;
  142.     }
  143.     public function getUpdatedAt(): ?\DateTimeInterface
  144.     {
  145.         return $this->updatedAt;
  146.     }
  147.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  148.     {
  149.         $this->updatedAt $updatedAt;
  150.         return $this;
  151.     }
  152.     public function getNom(): ?string
  153.     {
  154.         return $this->nom;
  155.     }
  156.     public function setNom(?string $nom): self
  157.     {
  158.         $this->nom $nom;
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return Collection<int, Agora>
  163.      */
  164.     public function getAgoras(): Collection
  165.     {
  166.         return $this->agoras;
  167.     }
  168.     public function addAgora(Agora $agora): self
  169.     {
  170.         if (!$this->agoras->contains($agora)) {
  171.             $this->agoras[] = $agora;
  172.             $agora->setSouscategorie($this);
  173.         }
  174.         return $this;
  175.     }
  176.     public function removeAgora(Agora $agora): self
  177.     {
  178.         if ($this->agoras->removeElement($agora)) {
  179.             // set the owning side to null (unless already changed)
  180.             if ($agora->getSouscategorie() === $this) {
  181.                 $agora->setSouscategorie(null);
  182.             }
  183.         }
  184.         return $this;
  185.     }
  186.     public function getDescription(): ?string
  187.     {
  188.         return $this->description;
  189.     }
  190.     public function setDescription(?string $description): self
  191.     {
  192.         $this->description $description;
  193.         return $this;
  194.     }
  195.     public function getListorder(): ?int
  196.     {
  197.         return $this->listorder;
  198.     }
  199.     public function setListorder(?int $listorder): self
  200.     {
  201.         $this->listorder $listorder;
  202.         return $this;
  203.     }
  204.     public function getSrc(): ?string
  205.     {
  206.         return $this->src;
  207.     }
  208.     public function setSrc(?string $src): self
  209.     {
  210.         $this->src $src;
  211.         return $this;
  212.     }
  213.     public function getAlt(): ?string
  214.     {
  215.         return $this->alt;
  216.     }
  217.     public function setAlt(?string $alt): self
  218.     {
  219.         $this->alt $alt;
  220.         return $this;
  221.     }
  222.     public function getTitle(): ?string
  223.     {
  224.         return $this->title;
  225.     }
  226.     public function setTitle(?string $title): self
  227.     {
  228.         $this->title $title;
  229.         return $this;
  230.     }
  231.     public function getSrcImg(): ?string
  232.     {
  233.         return $this->srcImg;
  234.     }
  235.     public function setSrcImg(?string $srcImg): self
  236.     {
  237.         $this->srcImg $srcImg;
  238.         return $this;
  239.     }
  240.     public function getAltImg(): ?string
  241.     {
  242.         return $this->altImg;
  243.     }
  244.     public function setAltImg(?string $altImg): self
  245.     {
  246.         $this->altImg $altImg;
  247.         return $this;
  248.     }
  249.     public function getTitleImg(): ?string
  250.     {
  251.         return $this->titleImg;
  252.     }
  253.     public function setTitleImg(?string $titleImg): self
  254.     {
  255.         $this->titleImg $titleImg;
  256.         return $this;
  257.     }
  258.     public function getIntro(): ?string
  259.     {
  260.         return $this->intro;
  261.     }
  262.     public function setIntro(?string $intro): self
  263.     {
  264.         $this->intro $intro;
  265.         return $this;
  266.     }
  267. }