src/Entity/CRM/LeaveRequestType.php line 11

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\LeaveRequestTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassLeaveRequestTypeRepository::class)]
  8. class LeaveRequestType
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\Column]
  17.     private ?bool $isActive null;
  18.     #[ORM\Column]
  19.     private ?bool $isChildCare null;
  20.     #[ORM\OneToMany(mappedBy'leaveRequestType'targetEntityLeaveRequest::class)]
  21.     private Collection $LeaveRequest;
  22.     public function __toString(): string
  23.     {
  24.         return (string) $this->name;
  25.     }
  26.     public function __construct()
  27.     {
  28.         $this->LeaveRequest = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): static
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function isIsActive(): ?bool
  44.     {
  45.         return $this->isActive;
  46.     }
  47.     public function setIsActive(bool $isActive): static
  48.     {
  49.         $this->isActive $isActive;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, LeaveRequest>
  54.      */
  55.     public function getLeaveRequest(): Collection
  56.     {
  57.         return $this->LeaveRequest;
  58.     }
  59.     public function addLeaveRequest(LeaveRequest $leaveRequest): static
  60.     {
  61.         if (!$this->LeaveRequest->contains($leaveRequest)) {
  62.             $this->LeaveRequest->add($leaveRequest);
  63.             $leaveRequest->setLeaveRequestType($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeLeaveRequest(LeaveRequest $leaveRequest): static
  68.     {
  69.         if ($this->LeaveRequest->removeElement($leaveRequest)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($leaveRequest->getLeaveRequestType() === $this) {
  72.                 $leaveRequest->setLeaveRequestType(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     public function isChildCare(): ?bool
  78.     {
  79.         return $this->isChildCare;
  80.     }
  81.     public function setIsChildCare(?bool $isChildCare): void
  82.     {
  83.         $this->isChildCare $isChildCare;
  84.     }
  85. }