src/Entity/Gestiform/Formations/Catalogue/Filiere.php line 17
<?php
namespace App\Entity\Gestiform\Formations\Catalogue;
use App\Entity\AbstractEntity;
use App\Entity\Common\Upload;
use App\Entity\Gestiform\Formations\Catalogue\Parcours\Parcours;
use App\Repository\Gestiform\Formations\Catalogue\FiliereRepository;
use App\Entity\Trait\SortableEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FiliereRepository::class)]
class Filiere extends AbstractEntity
{
use SortableEntity;
#[ORM\Column(type: 'string', length: 255, nullable: false)]
private string $intitule;
#[ORM\Column(type: 'string', length: 255)]
private ?string $couleur = null;
#[ORM\JoinColumn(nullable: true)]
#[ORM\OneToOne(targetEntity: Upload::class, cascade: ['persist', 'remove'])]
private ?Upload $icon = null;
#[ORM\Column(type: 'boolean')]
private ?bool $publication = true;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $code=null;
#[ORM\OneToMany(mappedBy: 'filiere', targetEntity: Parcours::class)]
private Collection $parcours;
public function __construct()
{
$this->parcours = new ArrayCollection();
}
public function getIntitule(): ?string
{
return $this->intitule;
}
public function setIntitule(string $intitule): self
{
$this->intitule = $intitule;
return $this;
}
public function getCouleur(): ?string
{
return $this->couleur;
}
public function setCouleur(string $couleur): self
{
$this->couleur = $couleur;
return $this;
}
public function getPublication(): ?bool
{
return $this->publication;
}
public function setPublication(?bool $publication): self
{
$this->publication = $publication;
return $this;
}
public function getParcours(): Collection
{
return $this->parcours;
}
public function getIcon(): ?Upload
{
return $this->icon;
}
public function setIcon(?Upload $icon): self
{
$this->icon = $icon;
return $this;
}
public function addParcours(Parcours $parcours): self
{
if (!$this->parcours->contains($parcours)) {
$this->parcours[] = $parcours;
$parcours->setFiliere($this);
}
return $this;
}
public function removeParcours(Parcours $parcours): self
{
// set the owning side to null (unless already changed)
if ($this->parcours->removeElement($parcours) && $parcours->getFiliere() === $this) {
$parcours->setFiliere(null);
}
return $this;
}
public function isPublication(): ?bool
{
return $this->publication;
}
public function addParcour(Parcours $parcour): self
{
if (!$this->parcours->contains($parcour)) {
$this->parcours->add($parcour);
$parcour->setFiliere($this);
}
return $this;
}
public function removeParcour(Parcours $parcour): self
{
// set the owning side to null (unless already changed)
if ($this->parcours->removeElement($parcour) && $parcour->getFiliere() === $this) {
$parcour->setFiliere(null);
}
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
}