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

  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\Entity\Trait\SortableEntity;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. #[ORM\Entity(repositoryClassFiliereRepository::class)]
  12. class Filiere extends AbstractEntity
  13. {
  14.     use SortableEntity;
  15.     #[ORM\Column(type'string'length255nullablefalse)]
  16.     private string $intitule;
  17.     #[ORM\Column(type'string'length255)]
  18.     private ?string $couleur null;
  19.     #[ORM\Column(type'boolean')]
  20.     private ?bool $publication true;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private ?string $code=null;
  23.     #[ORM\OneToOne(targetEntityUpload::class)]
  24.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  25.     private ?Upload $icon null;
  26.     #[ORM\OneToMany(targetEntityParcours::class, mappedBy'filiere')]
  27.     private Collection $parcours;
  28.     public function __construct()
  29.     {
  30.         $this->parcours = new ArrayCollection();
  31.     }
  32.     public function getIntitule(): ?string
  33.     {
  34.         return $this->intitule;
  35.     }
  36.     public function setIntitule(string $intitule): self
  37.     {
  38.         $this->intitule $intitule;
  39.         return $this;
  40.     }
  41.     public function getCouleur(): ?string
  42.     {
  43.         return $this->couleur;
  44.     }
  45.     public function setCouleur(string $couleur): self
  46.     {
  47.         $this->couleur $couleur;
  48.         return $this;
  49.     }
  50.     public function getPublication(): ?bool
  51.     {
  52.         return $this->publication;
  53.     }
  54.     public function setPublication(?bool $publication): self
  55.     {
  56.         $this->publication $publication;
  57.         return $this;
  58.     }
  59.     public function getParcours(): Collection
  60.     {
  61.         return $this->parcours;
  62.     }
  63.     public function getIcon(): ?Upload
  64.     {
  65.         return $this->icon;
  66.     }
  67.     public function setIcon(?Upload $icon): self
  68.     {
  69.         $this->icon $icon;
  70.         return $this;
  71.     }
  72.     public function addParcours(Parcours $parcours): self
  73.     {
  74.         if (!$this->parcours->contains($parcours)) {
  75.             $this->parcours[] = $parcours;
  76.             $parcours->setFiliere($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeParcours(Parcours $parcours): self
  81.     {
  82.         // set the owning side to null (unless already changed)
  83.         if ($this->parcours->removeElement($parcours) && $parcours->getFiliere() === $this) {
  84.             $parcours->setFiliere(null);
  85.         }
  86.         return $this;
  87.     }
  88.     public function isPublication(): ?bool
  89.     {
  90.         return $this->publication;
  91.     }
  92.     public function addParcour(Parcours $parcour): self
  93.     {
  94.         if (!$this->parcours->contains($parcour)) {
  95.             $this->parcours->add($parcour);
  96.             $parcour->setFiliere($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeParcour(Parcours $parcour): self
  101.     {
  102.         // set the owning side to null (unless already changed)
  103.         if ($this->parcours->removeElement($parcour) && $parcour->getFiliere() === $this) {
  104.             $parcour->setFiliere(null);
  105.         }
  106.         return $this;
  107.     }
  108.     public function getCode(): ?string
  109.     {
  110.         return $this->code;
  111.     }
  112.     public function setCode(?string $code): self
  113.     {
  114.         $this->code $code;
  115.         return $this;
  116.     }
  117. }