src/Entity/Request/Priority.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Request;
  3. use App\Repository\Request\PriorityRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPriorityRepository::class)]
  8. class Priority
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column]
  15.     private ?int $priorityOrder null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $color null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $label null;
  20.     #[ORM\OneToMany(mappedBy'priority'targetEntityRequestForm::class)]
  21.     private Collection $requestForms;
  22.     public function __construct()
  23.     {
  24.         $this->requestForms = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getPriorityOrder(): ?int
  31.     {
  32.         return $this->priorityOrder;
  33.     }
  34.     public function setPriorityOrder(int $priorityOrder): static
  35.     {
  36.         $this->priorityOrder $priorityOrder;
  37.         return $this;
  38.     }
  39.     public function getColor(): ?string
  40.     {
  41.         return $this->color;
  42.     }
  43.     public function setColor(string $color): static
  44.     {
  45.         $this->color $color;
  46.         return $this;
  47.     }
  48.     public function getLabel(): ?string
  49.     {
  50.         return $this->label;
  51.     }
  52.     public function setLabel(string $label): static
  53.     {
  54.         $this->label $label;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, RequestForm>
  59.      */
  60.     public function getRequestForms(): Collection
  61.     {
  62.         return $this->requestForms;
  63.     }
  64.     public function addRequestForm(RequestForm $requestForm): static
  65.     {
  66.         if (!$this->requestForms->contains($requestForm)) {
  67.             $this->requestForms->add($requestForm);
  68.             $requestForm->setPriority($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeRequestForm(RequestForm $requestForm): static
  73.     {
  74.         if ($this->requestForms->removeElement($requestForm)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($requestForm->getPriority() === $this) {
  77.                 $requestForm->setPriority(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }