src/Entity/LeaveRequest.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LeaveRequestRepository;
  4. use Symfony\Component\Serializer\Annotation\Groups;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassLeaveRequestRepository::class)]
  7. class LeaveRequest
  8. {
  9.     #[Groups(['LogService'])]
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[Groups(['LogService'])]
  15.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'leaveRequests')]
  16.     private $user;
  17.     #[Groups(['LogService'])]
  18.     #[ORM\Column(type'datetime')]
  19.     private $startDate;
  20.     #[Groups(['LogService'])]
  21.     #[ORM\Column(type'boolean')]
  22.     private $isHalfStart;
  23.     #[Groups(['LogService'])]
  24.     #[ORM\Column(type'datetime')]
  25.     private $endDate;
  26.     #[Groups(['LogService'])]
  27.     #[ORM\Column(type'boolean')]
  28.     private $isHalfEnd;
  29.     #[Groups(['LogService'])]
  30.     #[ORM\Column(type'decimal'precision4scale1)]
  31.     private $days;
  32.     #[Groups(['LogService'])]
  33.     #[ORM\Column(type'boolean'nullabletrue)]
  34.     private $isApproved;
  35.     #[Groups(['LogService'])]
  36.     #[ORM\Column(type'text'nullabletrue)]
  37.     private $comment;
  38.     #[ORM\Column(type'string'length128)]
  39.     private $createdBy;
  40.     #[ORM\Column(type'datetime')]
  41.     private $createdAt;
  42.     #[ORM\Column(type'datetime'nullabletrue)]
  43.     private $updatedAt;
  44.     #[ORM\Column(type'string'length128nullabletrue)]
  45.     private $deletedBy;
  46.     #[Groups(['LogService'])]
  47.     #[ORM\Column(type'datetime'nullabletrue)]
  48.     private $deletedAt;
  49.     #[Groups(['LogService'])]
  50.     #[ORM\ManyToOne(targetEntityLeaveType::class)]
  51.     #[ORM\JoinColumn(name'leave_type_id'referencedColumnName'id')]
  52.     private $leaveType;
  53.     #[Groups(['LogService'])]
  54.     #[ORM\Column(type'decimal'precision4scale1nullabletrue)]
  55.     private $daysLeft;
  56.     #[Groups(['LogService'])]
  57.     #[ORM\Column(type'text'nullabletrue)]
  58.     private $note;
  59.      #[ORM\Column(type'json'nullabletrue)]
  60.     private $alocation = [];
  61.     #[ORM\Column(type'json'nullabletrue)]
  62.     private $attributes;
  63.     #[ORM\Column(type'datetime'nullabletrue)]
  64.     private $lastReminder;
  65.     #[ORM\ManyToOne(targetEntityUser::class)]
  66.     private $updatedBy;
  67.     #[ORM\ManyToOne(targetEntityUser::class)]
  68.     private $reviewedBy;
  69.     #[ORM\Column(type'json'nullabletrue)]
  70.     private $log = [];
  71.     public function getId(): ?int
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getUser(): ?User
  76.     {
  77.         return $this->user;
  78.     }
  79.     public function setUser(?User $user): self
  80.     {
  81.         $this->user $user;
  82.         return $this;
  83.     }
  84.     public function getStartDate(): ?\DateTime
  85.     {
  86.         return $this->startDate;
  87.     }
  88.     public function setStartDate(\DateTime $startDate): self
  89.     {
  90.         $this->startDate $startDate;
  91.         return $this;
  92.     }
  93.     public function getEndDate(): ?\DateTime
  94.     {
  95.         return $this->endDate;
  96.     }
  97.     public function setEndDate(\DateTime $endDate): self
  98.     {
  99.         $this->endDate $endDate;
  100.         return $this;
  101.     }
  102.     public function getDays(): ?string
  103.     {
  104.         return $this->days;
  105.     }
  106.     public function setDays(string $days): self
  107.     {
  108.         $this->days $days;
  109.         return $this;
  110.     }
  111.     public function getCreatedBy(): ?string
  112.     {
  113.         return $this->createdBy;
  114.     }
  115.     public function setCreatedBy(string $createdBy): self
  116.     {
  117.         $this->createdBy $createdBy;
  118.         return $this;
  119.     }
  120.     public function getCreatedAt(): ?\DateTime
  121.     {
  122.         return $this->createdAt;
  123.     }
  124.     public function setCreatedAt(\DateTime $createdAt): self
  125.     {
  126.         $this->createdAt $createdAt;
  127.         return $this;
  128.     }
  129.     public function getUpdatedAt(): ?\DateTimeInterface
  130.     {
  131.         return $this->updatedAt;
  132.     }
  133.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  134.     {
  135.         $this->updatedAt $updatedAt;
  136.         return $this;
  137.     }
  138.     public function getDeletedBy(): ?string
  139.     {
  140.         return $this->deletedBy;
  141.     }
  142.     public function setDeletedBy(string $name): self
  143.     {
  144.         $this->deletedBy $name;
  145.         return $this;
  146.     }
  147.     public function getDeletedAt(): ?\DateTime
  148.     {
  149.         return $this->deletedAt;
  150.     }
  151.     public function setDeleteddAt(\DateTime $time): self
  152.     {
  153.         $this->deletedAt $time;
  154.         return $this;
  155.     }    
  156.     public function getIsHalfStart(): ?bool
  157.     {
  158.         return $this->isHalfStart;
  159.     }
  160.     public function setIsHalfStart(bool $isHalfStart): self
  161.     {
  162.         $this->isHalfStart $isHalfStart;
  163.         return $this;
  164.     }
  165.     public function getIsHalfEnd(): ?bool
  166.     {
  167.         return $this->isHalfEnd;
  168.     }
  169.     public function setIsHalfEnd(bool $isHalfEnd): self
  170.     {
  171.         $this->isHalfEnd $isHalfEnd;
  172.         return $this;
  173.     }
  174.     public function getIsApproved(): ?bool
  175.     {
  176.         return $this->isApproved;
  177.     }
  178.     public function getIsApproveds(): ?int{
  179.         $nn=1;
  180.         if($this->isApproved==0){$nn=0;}
  181.         if($nn!=0){
  182.             if($this->isApproved==null){$nn=2;}
  183.         }
  184.         return $nn;
  185.     }
  186.     public function setIsApproved(?bool $isApproved): self
  187.     {
  188.         $this->isApproved $isApproved;
  189.         return $this;
  190.     }
  191.     public function getComment(): ?string
  192.     {
  193.         return $this->comment;
  194.     }
  195.     public function setComment(?string $comment): self
  196.     {
  197.         $this->comment $comment;
  198.         return $this;
  199.     }
  200.     public function getLeaveType(): ?LeaveType
  201.     {
  202.         return $this->leaveType;
  203.     }
  204.     public function setLeaveType(LeaveType $leaveType): self
  205.     {
  206.         $this->leaveType $leaveType;
  207.         return $this;
  208.     }
  209.     public function getDaysLeft(): ?string
  210.     {
  211.         return $this->daysLeft;
  212.     }
  213.     public function setDaysLeft(?string $daysLeft): self
  214.     {
  215.         $this->daysLeft $daysLeft;
  216.         return $this;
  217.     }
  218.     public function getNote(): ?string
  219.     {
  220.         return $this->note;
  221.     }
  222.     public function setNote(?string $note): self
  223.     {
  224.         $this->note $note;
  225.         return $this;
  226.     }
  227.     public function getAlocation(): ?array
  228.     {
  229.         return $this->alocation;
  230.     }
  231.     public function setAlocation(?array $alocation): self
  232.     {
  233.         $this->alocation $alocation;
  234.         return $this;
  235.     }
  236.     public function getAttributes(): ?array
  237.     {
  238.         return $this->attributes;
  239.     }
  240.     public function setAttributes(?array $attributes): self
  241.     {
  242.         $this->attributes $attributes;
  243.         return $this;
  244.     }
  245.     public function getLastReminder(): ?\DateTimeInterface
  246.     {
  247.         return $this->lastReminder;
  248.     }
  249.     public function setLastReminder(?\DateTimeInterface $lastReminder): self
  250.     {
  251.         $this->lastReminder $lastReminder;
  252.         return $this;
  253.     }
  254.     public function getUpdatedBy(): ?User
  255.     {
  256.         return $this->updatedBy;
  257.     }
  258.     public function setUpdatedBy(?User $updatedBy): self
  259.     {
  260.         $this->updatedBy $updatedBy;
  261.         return $this;
  262.     }
  263.     public function getReviewedBy(): ?User
  264.     {
  265.         return $this->reviewedBy;
  266.     }
  267.     public function setReviewedBy(?User $reviewedBy): self
  268.     {
  269.         $this->reviewedBy $reviewedBy;
  270.         return $this;
  271.     }
  272.     public function getLog(): ?array
  273.     {
  274.         return $this->log;
  275.     }
  276.     public function setLog(?array $log): self
  277.     {
  278.         $this->log $log;
  279.         return $this;
  280.     }
  281. }