src/Entity/LeaveType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LeaveTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassLeaveTypeRepository::class)]
  8. class LeaveType
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length128)]
  15.     private $leaveName;
  16.     #[ORM\Column(type'boolean'nullabletrue)]
  17.     private $isActive;
  18.     #[ORM\Column(type'boolean'nullablefalse)]
  19.     private $isMandatory false;
  20.     #[ORM\Column(type'decimal'precision4scale1nullabletrue)]
  21.     private $days;
  22.     #[ORM\ManyToOne(targetEntityOffice::class, inversedBy'leaveTypes')]
  23.     private $office;
  24.     #[ORM\Column(type'json'nullabletrue)]
  25.     private $attributes = [];
  26.     #[ORM\Column(type'datetime'nullabletrue)]
  27.     private $createdAt;
  28.     #[ORM\Column(type'integer'nullabletrue)]
  29.     private $createdBy;
  30.     #[ORM\Column(type'datetime'nullabletrue)]
  31.     private $updatedAt;
  32.     #[ORM\Column(type'integer'nullabletrue)]
  33.     private $updatedBy;
  34.     #[ORM\OneToMany(targetEntityLeaveEntitlement::class, mappedBy'leaveType')]
  35.     private $leaveEntitlements;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private $description;
  38.     #[ORM\Column(type'integer'nullabletrue)]
  39.     private $parent;
  40.     #[ORM\Column(type'json'nullabletrue)]
  41.     private $log = [];
  42.     public function __construct()
  43.     {
  44.         $this->leaveEntitlements = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getLeaveName(): ?string
  51.     {
  52.         return $this->leaveName;
  53.     }
  54.     public function setLeaveName(string $leaveName): self
  55.     {  
  56.         $this->leaveName $leaveName;
  57.         return $this;
  58.     }
  59.     public function getIsActive(): ?bool
  60.     {
  61.         return $this->isActive;
  62.     }
  63.     public function setIsActive(?bool $isActive): self
  64.     {
  65.         $this->isActive $isActive;
  66.         return $this;
  67.     }
  68.     public function getIsMandatory(): ?bool
  69.     {
  70.         return $this->isMandatory;
  71.     }
  72.     public function setIsMandatory(?bool $isMandatory): self
  73.     {
  74.         $this->isMandatory $isMandatory;
  75.         return $this;
  76.     }
  77.     public function getDays(): ?string
  78.     {
  79.         return $this->days;
  80.     }
  81.     public function setDays(?string $days): self
  82.     {
  83.         $this->days $days;
  84.         return $this;
  85.     }
  86.     public function getOffice(): ?Office
  87.     {
  88.         return $this->office;
  89.     }
  90.     public function setOffice(?Office $office): self
  91.     {
  92.         $this->office $office;
  93.         return $this;
  94.     }
  95.     public function getAttributes(): ?array
  96.     {
  97.         return $this->attributes;
  98.     }
  99.     public function setAttributes(?array $attributes): self
  100.     {
  101.         $this->attributes $attributes;
  102.         return $this;
  103.     }
  104.     public function getCreatedAt(): ?\DateTimeInterface
  105.     {
  106.         return $this->createdAt;
  107.     }
  108.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  109.     {
  110.         $this->createdAt $createdAt;
  111.         return $this;
  112.     }
  113.     public function getCreatedBy(): ?int
  114.     {
  115.         return $this->createdBy;
  116.     }
  117.     public function setCreatedBy(?int $createdBy): self
  118.     {
  119.         $this->createdBy $createdBy;
  120.         return $this;
  121.     }
  122.     public function getUpdatedAt(): ?\DateTimeInterface
  123.     {
  124.         return $this->updatedAt;
  125.     }
  126.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  127.     {
  128.         $this->updatedAt $updatedAt;
  129.         return $this;
  130.     }
  131.     public function getUpdatedBy(): ?string
  132.     {
  133.         return $this->updatedBy;
  134.     }
  135.     public function setUpdatedBy(?string $updatedBy): self
  136.     {
  137.         $this->updatedBy $updatedBy;
  138.         return $this;
  139.     }
  140.     public function getDescription(): ?string
  141.     {
  142.         return $this->description;
  143.     }
  144.     public function setDescription(?string $desc): self
  145.     {
  146.         $this->description $desc;
  147.         return $this;
  148.     }
  149.     public function getParent(): ?int
  150.     {
  151.         return $this->parent;
  152.     }
  153.     public function setParent(?int $parent): self
  154.     {
  155.         $this->parent $parent;
  156.         return $this;
  157.     }
  158.     public function getLog(): ?array
  159.     {
  160.         return $this->log;
  161.     }
  162.     public function setLog(?array $log): self
  163.     {
  164.         $this->log $log;
  165.         return $this;
  166.     }
  167.     /**
  168.      * @return Collection<int, LeaveEntitlement>
  169.      */
  170.     public function getLeaveEntitlements(): Collection
  171.     {
  172.         return $this->leaveEntitlements;
  173.     }
  174.     public function addLeaveEntitlement(LeaveEntitlement $leaveEntitlement): self
  175.     {
  176.         if (!$this->leaveEntitlements->contains($leaveEntitlement)) {
  177.             $this->leaveEntitlements[] = $leaveEntitlement;
  178.             $leaveEntitlement->setLeaveType($this);
  179.         }
  180.         return $this;
  181.     }
  182.     public function removeLeaveEntitlement(LeaveEntitlement $leaveEntitlement): self
  183.     {
  184.         if ($this->leaveEntitlements->removeElement($leaveEntitlement)) {
  185.             // set the owning side to null (unless already changed)
  186.             if ($leaveEntitlement->getLeaveType() === $this) {
  187.                 $leaveEntitlement->setLeaveType(null);
  188.             }
  189.         }
  190.         return $this;
  191.     }
  192. }