src/Entity/Request/RequestType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Request;
  3. use App\Repository\Request\RequestTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassRequestTypeRepository::class)]
  8. class RequestType
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $label null;
  16.     #[ORM\OneToMany(mappedBy'requestType'targetEntityRequestForm::class)]
  17.     private Collection $requestForms;
  18.     public function __construct()
  19.     {
  20.         $this->requestForms = new ArrayCollection();
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getLabel(): ?string
  27.     {
  28.         return $this->label;
  29.     }
  30.     public function setLabel(string $label): static
  31.     {
  32.         $this->label $label;
  33.         return $this;
  34.     }
  35.     /**
  36.      * @return Collection<int, RequestForm>
  37.      */
  38.     public function getRequestForms(): Collection
  39.     {
  40.         return $this->requestForms;
  41.     }
  42.     public function addRequestForm(RequestForm $requestForm): static
  43.     {
  44.         if (!$this->requestForms->contains($requestForm)) {
  45.             $this->requestForms->add($requestForm);
  46.             $requestForm->setRequestType($this);
  47.         }
  48.         return $this;
  49.     }
  50.     public function removeRequestForm(RequestForm $requestForm): static
  51.     {
  52.         if ($this->requestForms->removeElement($requestForm)) {
  53.             // set the owning side to null (unless already changed)
  54.             if ($requestForm->getRequestType() === $this) {
  55.                 $requestForm->setRequestType(null);
  56.             }
  57.         }
  58.         return $this;
  59.     }
  60. }