src/Entity/CourseAutoEnrollment.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CourseAutoEnrollmentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClassCourseAutoEnrollmentRepository::class)]
  9. class CourseAutoEnrollment
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     #[Groups(['LogService'])]
  15.     private $id;
  16.     #[ORM\ManyToOne(targetEntityCourse::class, inversedBy'courseAutoEnrollments')]
  17.     #[Groups(['LogService'])]
  18.     private $course;
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private $status;
  21.     #[ORM\ManyToMany(targetEntityDepartment::class, inversedBy'courseAutoEnrollments')]
  22.     private $departments;
  23.     #[ORM\JoinTable(name'office_course_auto_enrollment')]
  24.     #[ORM\JoinColumn(name'course_auto_enrollment_id'referencedColumnName'id')]
  25.     #[ORM\InverseJoinColumn(name'office_id'referencedColumnName'id')]
  26.     #[ORM\ManyToMany(targetEntityOffice::class, inversedBy'courseAutoEnrollments')]
  27.     private $offices;
  28.     #[ORM\Column(type'string'length255)]
  29.     #[Groups(['LogService'])]
  30.     private $courseType;
  31.     #[ORM\Column(type'integer'nullabletrue)]
  32.     #[Groups(['LogService'])]
  33.     private $enrolledDays;
  34.     #[ORM\Column(type'datetime_immutable')]
  35.     private $createdAt;
  36.     #[ORM\ManyToOne(targetEntityUser::class)]
  37.     private $createdBy;
  38.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  39.     private $updatedAt;
  40.     #[ORM\ManyToOne(targetEntityUser::class)]
  41.     private $updatedBy;
  42.     public function __construct()
  43.     {
  44.         $this->departments = new ArrayCollection();
  45.         $this->offices = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getCourse(): ?Course
  52.     {
  53.         return $this->course;
  54.     }
  55.     public function setCourse(?Course $course): self
  56.     {
  57.         $this->course $course;
  58.         return $this;
  59.     }
  60.     public function getStatus(): ?string
  61.     {
  62.         return $this->status;
  63.     }
  64.     public function setStatus(?string $status): self
  65.     {
  66.         $this->status $status;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection|Department[]
  71.      */
  72.     public function getDepartments(): Collection
  73.     {
  74.         return $this->departments;
  75.     }
  76.     public function addDepartment(Department $department): self
  77.     {
  78.         if (!$this->departments->contains($department)) {
  79.             $this->departments[] = $department;
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeDepartment(Department $department): self
  84.     {
  85.         $this->departments->removeElement($department);
  86.         return $this;
  87.     }
  88.     /**
  89.      * @return Collection|Office[]
  90.      */
  91.     public function getOffices(): Collection
  92.     {
  93.         return $this->offices;
  94.     }
  95.     public function addOffice(Office $office): self
  96.     {
  97.         if (!$this->offices->contains($office)) {
  98.             $this->offices[] = $office;
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeOffice(Office $office): self
  103.     {
  104.         $this->offices->removeElement($office);
  105.         return $this;
  106.     }
  107.     
  108.     public function getCourseType(): ?string
  109.     {
  110.         return $this->courseType;
  111.     }
  112.     public function setCourseType(string $courseType): self
  113.     {
  114.         $this->courseType $courseType;
  115.         return $this;
  116.     }
  117.     public function getEnrolledDays(): ?int
  118.     {
  119.         return $this->enrolledDays;
  120.     }
  121.     public function setEnrolledDays(?int $enrolledDays): self
  122.     {
  123.         $this->enrolledDays $enrolledDays;
  124.         return $this;
  125.     }
  126.     public function getCreatedAt(): ?\DateTimeImmutable
  127.     {
  128.         return $this->createdAt;
  129.     }
  130.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  131.     {
  132.         $this->createdAt $createdAt;
  133.         return $this;
  134.     }
  135.     public function getCreatedBy(): ?User
  136.     {
  137.         return $this->createdBy;
  138.     }
  139.     public function setCreatedBy(?User $createdBy): self
  140.     {
  141.         $this->createdBy $createdBy;
  142.         return $this;
  143.     }
  144.     public function getUpdatedAt(): ?\DateTimeImmutable
  145.     {
  146.         return $this->updatedAt;
  147.     }
  148.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  149.     {
  150.         $this->updatedAt $updatedAt;
  151.         return $this;
  152.     }
  153.     public function getUpdatedBy(): ?User
  154.     {
  155.         return $this->updatedBy;
  156.     }
  157.     public function setUpdatedBy(?User $updatedBy): self
  158.     {
  159.         $this->updatedBy $updatedBy;
  160.         return $this;
  161.     }
  162. }