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\OneToMany(mappedBy'leaveRequestType'targetEntityLeaveRequest::class)]
  19.     private Collection $LeaveRequest;
  20.     public function __toString(): string
  21.     {
  22.         return (string) $this->name;
  23.     }
  24.     public function __construct()
  25.     {
  26.         $this->LeaveRequest = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getName(): ?string
  33.     {
  34.         return $this->name;
  35.     }
  36.     public function setName(string $name): static
  37.     {
  38.         $this->name $name;
  39.         return $this;
  40.     }
  41.     public function isIsActive(): ?bool
  42.     {
  43.         return $this->isActive;
  44.     }
  45.     public function setIsActive(bool $isActive): static
  46.     {
  47.         $this->isActive $isActive;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, LeaveRequest>
  52.      */
  53.     public function getLeaveRequest(): Collection
  54.     {
  55.         return $this->LeaveRequest;
  56.     }
  57.     public function addLeaveRequest(LeaveRequest $leaveRequest): static
  58.     {
  59.         if (!$this->LeaveRequest->contains($leaveRequest)) {
  60.             $this->LeaveRequest->add($leaveRequest);
  61.             $leaveRequest->setLeaveRequestType($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeLeaveRequest(LeaveRequest $leaveRequest): static
  66.     {
  67.         if ($this->LeaveRequest->removeElement($leaveRequest)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($leaveRequest->getLeaveRequestType() === $this) {
  70.                 $leaveRequest->setLeaveRequestType(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75. }