src/Entity/EmployeeHourLog.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Helper\Timestamps;
  4. use App\Enum\EmployeeHourLog\InOut;
  5. use App\Repository\EmployeeHourLogRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EmployeeHourLogRepository::class)
  9.  */
  10. class EmployeeHourLog
  11. {
  12.     use Timestamps;
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=Employee::class, inversedBy="employeeHourLogs")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $employee;
  24.     /**
  25.      * @ORM\Column(type="datetime")
  26.      */
  27.     private $date;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private $comment;
  32.     /**
  33.      * @ORM\Column(type="inOut")
  34.      */
  35.     private ?InOut $inOut null;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getEmployee(): ?Employee
  41.     {
  42.         return $this->employee;
  43.     }
  44.     public function setEmployee(?Employee $employee): self
  45.     {
  46.         $this->employee $employee;
  47.         return $this;
  48.     }
  49.     public function getDate(): ?\DateTimeInterface
  50.     {
  51.         return $this->date;
  52.     }
  53.     public function setDate(\DateTimeInterface $date): self
  54.     {
  55.         $this->date $date;
  56.         return $this;
  57.     }
  58.     public function getComment(): ?string
  59.     {
  60.         return $this->comment;
  61.     }
  62.     public function setComment(?string $comment): self
  63.     {
  64.         $this->comment $comment;
  65.         return $this;
  66.     }
  67.     public function getInOut(): ?InOut
  68.     {
  69.         return $this->inOut;
  70.     }
  71.     public function setInOut(InOut $inOut): self
  72.     {
  73.         $this->inOut $inOut;
  74.         return $this;
  75.     }
  76.     public function isIn() : bool
  77.     {
  78.         return InOut::IN === $this->inOut;
  79.     }
  80.     public function isOut() : bool
  81.     {
  82.         return InOut::OUT === $this->inOut;
  83.     }
  84. }