<?php
namespace App\Entity;
use App\Repository\StudyLevelRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StudyLevelRepository::class)]
class StudyLevel
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $description = null;
#[ORM\OneToMany(targetEntity: Profile::class, mappedBy: 'studyLevel')]
private Collection $profiles;
#[ORM\OneToMany(targetEntity: Offer::class, mappedBy: 'studyLevel')]
private Collection $offers;
#[ORM\OneToMany(targetEntity: JobCandidate::class, mappedBy: 'studyLevel')]
private Collection $jobCandidates;
public function __construct()
{
$this->profiles = new ArrayCollection();
$this->offers = new ArrayCollection();
$this->jobCandidates = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection<int, Profile>
*/
public function getProfiles(): Collection
{
return $this->profiles;
}
public function addProfile(Profile $profile): self
{
if (!$this->profiles->contains($profile)) {
$this->profiles[] = $profile;
$profile->setStudyLevel($this);
}
return $this;
}
public function removeProfile(Profile $profile): self
{
if ($this->profiles->removeElement($profile)) {
// set the owning side to null (unless already changed)
if ($profile->getStudyLevel() === $this) {
$profile->setStudyLevel(null);
}
}
return $this;
}
/**
* @return Collection<int, Offer>
*/
public function getOffers(): Collection
{
return $this->offers;
}
public function addOffer(Offer $offer): self
{
if (!$this->offers->contains($offer)) {
$this->offers[] = $offer;
$offer->setStudyLevel($this);
}
return $this;
}
public function removeOffer(Offer $offer): self
{
if ($this->offers->removeElement($offer)) {
// set the owning side to null (unless already changed)
if ($offer->getStudyLevel() === $this) {
$offer->setStudyLevel(null);
}
}
return $this;
}
/**
* @return Collection<int, JobCandidate>
*/
public function getJobCandidates(): Collection
{
return $this->jobCandidates;
}
public function addJobCandidate(JobCandidate $jobCandidate): self
{
if (!$this->jobCandidates->contains($jobCandidate)) {
$this->jobCandidates[] = $jobCandidate;
$jobCandidate->setStudyLevel($this);
}
return $this;
}
public function removeJobCandidate(JobCandidate $jobCandidate): self
{
if ($this->jobCandidates->removeElement($jobCandidate)) {
// set the owning side to null (unless already changed)
if ($jobCandidate->getStudyLevel() === $this) {
$jobCandidate->setStudyLevel(null);
}
}
return $this;
}
}