src/Entity/Metier.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity()]
  7. class Metier
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\ManyToOne(targetEntitySecteur::class, inversedBy'metiers')]
  14.     #[ORM\JoinColumn(nullabletrue)]
  15.     private $secteur;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $nom;
  18.     #[ORM\ManyToOne(targetEntityUser::class)]
  19.     #[ORM\JoinColumn(nullabletrue)]
  20.     private $user;
  21.     #[ORM\Column(type'date'nullabletrue)]
  22.     private $creation;
  23.     #[ORM\Column(type'datetime'nullabletrue)]
  24.     private $modification;
  25.     #[ORM\OneToMany(mappedBy'metier'targetEntityEtablissementMetier::class)]
  26.     private $etablissementMetiers;
  27.     #[ORM\OneToMany(mappedBy'metier'targetEntityCandidature::class)]
  28.     private $candidatures;
  29.     public function __construct()
  30.     {
  31.         $this->etablissementMetiers = new ArrayCollection();
  32.         $this->candidatures = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getSecteur(): ?Secteur
  39.     {
  40.         return $this->secteur;
  41.     }
  42.     public function setSecteur(?Secteur $secteur): self
  43.     {
  44.         $this->secteur $secteur;
  45.         return $this;
  46.     }
  47.     public function getNom(): ?string
  48.     {
  49.         return $this->nom;
  50.     }
  51.     public function setNom(?string $nom): self
  52.     {
  53.         $this->nom $nom;
  54.         return $this;
  55.     }
  56.     public function getUser(): ?User
  57.     {
  58.         return $this->user;
  59.     }
  60.     public function setUser(?User $user): self
  61.     {
  62.         $this->user $user;
  63.         return $this;
  64.     }
  65.     public function getCreation(): ?\DateTimeInterface
  66.     {
  67.         return $this->creation;
  68.     }
  69.     public function setCreation(?\DateTimeInterface $creation): self
  70.     {
  71.         $this->creation $creation;
  72.         return $this;
  73.     }
  74.     public function getModification(): ?\DateTimeInterface
  75.     {
  76.         return $this->modification;
  77.     }
  78.     public function setModification(?\DateTimeInterface $modification): self
  79.     {
  80.         $this->modification $modification;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, EtablissementMetier>
  85.      */
  86.     public function getEtablissementMetiers(): Collection
  87.     {
  88.         return $this->etablissementMetiers;
  89.     }
  90.     public function addEtablissementMetier(EtablissementMetier $etablissementMetier): self
  91.     {
  92.         if (!$this->etablissementMetiers->contains($etablissementMetier)) {
  93.             $this->etablissementMetiers[] = $etablissementMetier;
  94.             $etablissementMetier->setMetier($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeEtablissementMetier(EtablissementMetier $etablissementMetier): self
  99.     {
  100.         if ($this->etablissementMetiers->removeElement($etablissementMetier)) {
  101.             if ($etablissementMetier->getMetier() === $this) {
  102.                 $etablissementMetier->setMetier(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection<int, Candidature>
  109.      */
  110.     public function getCandidatures(): Collection
  111.     {
  112.         return $this->candidatures;
  113.     }
  114.     public function addCandidature(Candidature $candidature): self
  115.     {
  116.         if (!$this->candidatures->contains($candidature)) {
  117.             $this->candidatures[] = $candidature;
  118.             $candidature->setMetier($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeCandidature(Candidature $candidature): self
  123.     {
  124.         if ($this->candidatures->removeElement($candidature)) {
  125.             if ($candidature->getMetier() === $this) {
  126.                 $candidature->setMetier(null);
  127.             }
  128.         }
  129.         return $this;
  130.     }
  131. }