src/Entity/StudyLevel.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StudyLevelRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassStudyLevelRepository::class)]
  8. class StudyLevel
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private ?string $name null;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private ?string $description null;
  18.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'studyLevel')]
  19.     private Collection $profiles;
  20.     #[ORM\OneToMany(targetEntityOffer::class, mappedBy'studyLevel')]
  21.     private Collection $offers;
  22.     #[ORM\OneToMany(targetEntityJobCandidate::class, mappedBy'studyLevel')]
  23.     private Collection $jobCandidates;
  24.     public function __construct()
  25.     {
  26.         $this->profiles = new ArrayCollection();
  27.         $this->offers = new ArrayCollection();
  28.         $this->jobCandidates = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(?string $name): self
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function getDescription(): ?string
  44.     {
  45.         return $this->description;
  46.     }
  47.     public function setDescription(?string $description): self
  48.     {
  49.         $this->description $description;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, Profile>
  54.      */
  55.     public function getProfiles(): Collection
  56.     {
  57.         return $this->profiles;
  58.     }
  59.     public function addProfile(Profile $profile): self
  60.     {
  61.         if (!$this->profiles->contains($profile)) {
  62.             $this->profiles[] = $profile;
  63.             $profile->setStudyLevel($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeProfile(Profile $profile): self
  68.     {
  69.         if ($this->profiles->removeElement($profile)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($profile->getStudyLevel() === $this) {
  72.                 $profile->setStudyLevel(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, Offer>
  79.      */
  80.     public function getOffers(): Collection
  81.     {
  82.         return $this->offers;
  83.     }
  84.     public function addOffer(Offer $offer): self
  85.     {
  86.         if (!$this->offers->contains($offer)) {
  87.             $this->offers[] = $offer;
  88.             $offer->setStudyLevel($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeOffer(Offer $offer): self
  93.     {
  94.         if ($this->offers->removeElement($offer)) {
  95.             // set the owning side to null (unless already changed)
  96.             if ($offer->getStudyLevel() === $this) {
  97.                 $offer->setStudyLevel(null);
  98.             }
  99.         }
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection<int, JobCandidate>
  104.      */
  105.     public function getJobCandidates(): Collection
  106.     {
  107.         return $this->jobCandidates;
  108.     }
  109.     public function addJobCandidate(JobCandidate $jobCandidate): self
  110.     {
  111.         if (!$this->jobCandidates->contains($jobCandidate)) {
  112.             $this->jobCandidates[] = $jobCandidate;
  113.             $jobCandidate->setStudyLevel($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeJobCandidate(JobCandidate $jobCandidate): self
  118.     {
  119.         if ($this->jobCandidates->removeElement($jobCandidate)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($jobCandidate->getStudyLevel() === $this) {
  122.                 $jobCandidate->setStudyLevel(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127. }