src/Entity/Employee.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmployeeRepository;
  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. #[ORM\Entity(repositoryClassEmployeeRepository::class)]
  9. class Employee
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $firstname null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $lastname null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $email null;
  21.     #[ORM\ManyToOne(inversedBy'employees')]
  22.     private ?ReviewForm $reviewForm null;
  23.     #[ORM\Column]
  24.     private ?bool $deleted null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  26.     private ?\DateTimeInterface $createdAt null;
  27.     #[ORM\ManyToOne(inversedBy'employees')]
  28.     private ?Client $client null;
  29.     #[ORM\OneToMany(targetEntitySession::class, mappedBy'employee')]
  30.     private Collection $sessions;
  31.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  32.     private ?\DateTimeInterface $birthdate null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $employee_function null;
  35.     public function __construct()
  36.     {
  37.         $this->sessions = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getFirstname(): ?string
  44.     {
  45.         return $this->firstname;
  46.     }
  47.     public function setFirstname(?string $firstname): static
  48.     {
  49.         $this->firstname $firstname;
  50.         return $this;
  51.     }
  52.     public function getLastname(): ?string
  53.     {
  54.         return $this->lastname;
  55.     }
  56.     public function setLastname(?string $lastname): static
  57.     {
  58.         $this->lastname $lastname;
  59.         return $this;
  60.     }
  61.     public function getEmail(): ?string
  62.     {
  63.         return $this->email;
  64.     }
  65.     public function setEmail(string $email): static
  66.     {
  67.         $this->email $email;
  68.         return $this;
  69.     }
  70.     public function getReviewForm(): ?ReviewForm
  71.     {
  72.         return $this->reviewForm;
  73.     }
  74.     public function setReviewForm(?ReviewForm $reviewForm): static
  75.     {
  76.         $this->reviewForm $reviewForm;
  77.         return $this;
  78.     }
  79.     public function isDeleted(): ?bool
  80.     {
  81.         return $this->deleted;
  82.     }
  83.     public function setDeleted(bool $deleted): static
  84.     {
  85.         $this->deleted $deleted;
  86.         return $this;
  87.     }
  88.     public function getCreatedAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->createdAt;
  91.     }
  92.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  93.     {
  94.         $this->createdAt $createdAt;
  95.         return $this;
  96.     }
  97.     public function getClient(): ?Client
  98.     {
  99.         return $this->client;
  100.     }
  101.     public function setClient(?Client $client): static
  102.     {
  103.         $this->client $client;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection<int, Session>
  108.      */
  109.     public function getSessions(): Collection
  110.     {
  111.         return $this->sessions;
  112.     }
  113.     public function addSession(Session $session): static
  114.     {
  115.         if (!$this->sessions->contains($session)) {
  116.             $this->sessions->add($session);
  117.             $session->setEmployee($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeSession(Session $session): static
  122.     {
  123.         if ($this->sessions->removeElement($session)) {
  124.             // set the owning side to null (unless already changed)
  125.             if ($session->getEmployee() === $this) {
  126.                 $session->setEmployee(null);
  127.             }
  128.         }
  129.         return $this;
  130.     }
  131.     public function getBirthdate(): ?\DateTimeInterface
  132.     {
  133.         return $this->birthdate;
  134.     }
  135.     public function setBirthdate(?\DateTimeInterface $birthdate): static
  136.     {
  137.         $this->birthdate $birthdate;
  138.         return $this;
  139.     }
  140.     public function getEmployeeFunction(): ?string
  141.     {
  142.         return $this->employee_function;
  143.     }
  144.     public function setEmployeeFunction(?string $employee_function): static
  145.     {
  146.         $this->employee_function $employee_function;
  147.         return $this;
  148.     }
  149. }