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