src/Entity/Secteur.php line 10
<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity()]class Secteur{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: 'integer')]private $id;#[ORM\Column(type: 'string', length: 255)]private $nom;#[ORM\ManyToOne(targetEntity: User::class)]#[ORM\JoinColumn(nullable: true)]private $user;#[ORM\Column(type: 'date', nullable: true)]private $creation;#[ORM\Column(type: 'datetime', nullable: true)]private $modification;#[ORM\OneToMany(mappedBy: 'secteur', targetEntity: Metier::class)]private $metiers;public function __construct(){$this->metiers = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getNom(): ?string{return $this->nom;}public function setNom(?string $nom): self{$this->nom = $nom;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): self{$this->user = $user;return $this;}public function getCreation(): ?\DateTimeInterface{return $this->creation;}public function setCreation(?\DateTimeInterface $creation): self{$this->creation = $creation;return $this;}public function getModification(): ?\DateTimeInterface{return $this->modification;}public function setModification(?\DateTimeInterface $modification): self{$this->modification = $modification;return $this;}/*** @return Collection<int, Metier>*/public function getMetiers(): Collection{return $this->metiers;}public function addMetier(Metier $metier): self{if (!$this->metiers->contains($metier)) {$this->metiers[] = $metier;$metier->setSecteur($this);}return $this;}public function removeMetier(Metier $metier): self{if ($this->metiers->removeElement($metier)) {if ($metier->getSecteur() === $this) {$metier->setSecteur(null);}}return $this;}}