src/Entity/Gestiform/Formations/Catalogue/Filiere.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Catalogue;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Upload;
  5. use App\Entity\Gestiform\Formations\Catalogue\Parcours\Parcours;
  6. use App\Repository\Gestiform\Formations\Catalogue\FiliereRepository;
  7. use App\Trait\SortableEntity;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12.  * @ORM\Entity(repositoryClass=FiliereRepository::class)
  13.  */
  14. class Filiere extends AbstractEntity
  15. {
  16.     use SortableEntity;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=false)
  19.      */
  20.     private string $intitule;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private ?string $couleur null;
  25.     /**
  26.      * @ORM\OneToOne(targetEntity=Upload::class, cascade={"persist", "remove"})
  27.      * @ORM\JoinColumn(nullable=true)
  28.      */
  29.     private ?Upload $icon null;
  30.     /**
  31.      * @ORM\Column(type="boolean")
  32.      */
  33.     private ?bool $publication true;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private ?string $code=null;
  38.     
  39.     /**
  40.      * @ORM\OneToMany(targetEntity=Parcours::class, mappedBy="filiere")
  41.      */
  42.     private Collection $parcours;
  43.     public function __construct()
  44.     {
  45.         $this->parcours = new ArrayCollection();
  46.     }
  47.     public function getIntitule(): ?string
  48.     {
  49.         return $this->intitule;
  50.     }
  51.     public function setIntitule(string $intitule): self
  52.     {
  53.         $this->intitule $intitule;
  54.         return $this;
  55.     }
  56.     public function getCouleur(): ?string
  57.     {
  58.         return $this->couleur;
  59.     }
  60.     public function setCouleur(string $couleur): self
  61.     {
  62.         $this->couleur $couleur;
  63.         return $this;
  64.     }
  65.     public function getPublication(): ?bool
  66.     {
  67.         return $this->publication;
  68.     }
  69.     public function setPublication(?bool $publication): self
  70.     {
  71.         $this->publication $publication;
  72.         return $this;
  73.     }
  74.     public function getParcours(): Collection
  75.     {
  76.         return $this->parcours;
  77.     }
  78.     public function getIcon(): ?Upload
  79.     {
  80.         return $this->icon;
  81.     }
  82.     public function setIcon(?Upload $icon): self
  83.     {
  84.         $this->icon $icon;
  85.         return $this;
  86.     }
  87.     public function addParcours(Parcours $parcours): self
  88.     {
  89.         if (!$this->parcours->contains($parcours)) {
  90.             $this->parcours[] = $parcours;
  91.             $parcours->setFiliere($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function removeParcours(Parcours $parcours): self
  96.     {
  97.         if ($this->parcours->removeElement($parcours)) {
  98.             // set the owning side to null (unless already changed)
  99.             if ($parcours->getFiliere() === $this) {
  100.                 $parcours->setFiliere(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105.     public function isPublication(): ?bool
  106.     {
  107.         return $this->publication;
  108.     }
  109.     public function addParcour(Parcours $parcour): self
  110.     {
  111.         if (!$this->parcours->contains($parcour)) {
  112.             $this->parcours->add($parcour);
  113.             $parcour->setFiliere($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeParcour(Parcours $parcour): self
  118.     {
  119.         if ($this->parcours->removeElement($parcour)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($parcour->getFiliere() === $this) {
  122.                 $parcour->setFiliere(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127.     public function getCode(): ?string
  128.     {
  129.         return $this->code;
  130.     }
  131.     public function setCode(?string $code): self
  132.     {
  133.         $this->code $code;
  134.         return $this;
  135.     }
  136. }