src/Entity/Degree.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DegreeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClassDegreeRepository::class)]
  10. class Degree
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     #[Groups(['list'])]
  16.     private ?int $id;
  17.     #[ORM\ManyToOne(targetEntityDegreeGroup::class)]
  18.     #[Groups(['list'])]
  19.     private ?DegreeGroup $degreeGroup;
  20.     #[ORM\Column(type'string'length250)]
  21.     #[Groups(['list'])]
  22.     private ?string $name;
  23.     #[ORM\Column(type'text'nullabletrue)]
  24.     #[Groups(['list'])]
  25.     private ?string $description;
  26.     #[ORM\Column(type'boolean')]
  27.     private ?bool $isDeleted;
  28.     #[ORM\Column(type'boolean')]
  29.     private ?bool $isTraining;
  30.     #[ORM\OneToMany(mappedBy'degree'targetEntityAdmission::class)]
  31.     private $admissions;
  32.     public function __construct()
  33.     {
  34.         $this->admissions = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getName(): ?string
  41.     {
  42.         return $this->name;
  43.     }
  44.     public function setName(string $name): self
  45.     {
  46.         $this->name $name;
  47.         return $this;
  48.     }
  49.     public function getDescription(): ?string
  50.     {
  51.         return $this->description;
  52.     }
  53.     public function setDescription(string $description): self
  54.     {
  55.         $this->description $description;
  56.         return $this;
  57.     }
  58.     public function isIsDeleted(): ?bool
  59.     {
  60.         return $this->isDeleted;
  61.     }
  62.     public function setIsDeleted(bool $isDeleted): self
  63.     {
  64.         $this->isDeleted $isDeleted;
  65.         return $this;
  66.     }
  67.     public function isIsTraining(): ?bool
  68.     {
  69.         return $this->isTraining;
  70.     }
  71.     public function setIsTraining(bool $isTraining): self
  72.     {
  73.         $this->isTraining $isTraining;
  74.         return $this;
  75.     }
  76.     public function getDegreeGroup(): ?DegreeGroup
  77.     {
  78.         return $this->degreeGroup;
  79.     }
  80.     public function setDegreeGroup(?DegreeGroup $degreeGroup): self
  81.     {
  82.         $this->degreeGroup $degreeGroup;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection|null
  87.      */
  88.     public function getAdmissions(): ?Collection
  89.     {
  90.         return $this->admissions;
  91.     }
  92.     public function addAdmission(Admission $admission): self
  93.     {
  94.         if (!$this->admissions->contains($admission)) {
  95.             $this->admissions[] = $admission;
  96.             $admission->setDegree($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeAdmission(Admission $admission): self
  101.     {
  102.         if ($this->admissions->removeElement($admission)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($admission->getDegree() === $this) {
  105.                 $admission->setDegree(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110. }