src/Entity/TaskFulfillmentReasons.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TaskFulfillmentReasonsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass=TaskFulfillmentReasonsRepository::class)
  10.  */
  11. class TaskFulfillmentReasons
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({
  18.      *     "task_fulfillment_reason@base",
  19.      *     "task_fulfillment_reason@core",
  20.      * })
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="string", length=64)
  25.      * @Groups({
  26.      *     "task_fulfillment_reason@base",
  27.      *     "task_fulfillment_reason@core"
  28.      * })
  29.      */
  30.     private $alias;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      * @Groups({
  34.      *       "task_fulfillment_reason@core"
  35.      *   })
  36.      */
  37.     private $description;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=ProjectOrderTaskFulfillment::class, mappedBy="reason")
  40.      */
  41.     private $project_order_task_fulfillments;
  42.     public function __construct()
  43.     {
  44.         $this->project_order_task_fulfillments = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getAlias(): ?string
  51.     {
  52.         return $this->alias;
  53.     }
  54.     public function setAlias(string $alias): self
  55.     {
  56.         $this->alias $alias;
  57.         return $this;
  58.     }
  59.     public function getDescription(): ?string
  60.     {
  61.         return $this->description;
  62.     }
  63.     public function setDescription(?string $description): self
  64.     {
  65.         $this->description $description;
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return Collection<int, ProjectOrderTaskFulfillment>
  70.      */
  71.     public function getProjectOrderTaskFulfillments(): Collection
  72.     {
  73.         return $this->project_order_task_fulfillments;
  74.     }
  75.     public function addProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  76.     {
  77.         if (!$this->project_order_task_fulfillments->contains($projectOrderTaskFulfillment)) {
  78.             $this->project_order_task_fulfillments[] = $projectOrderTaskFulfillment;
  79.             $projectOrderTaskFulfillment->setReason($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  84.     {
  85.         if ($this->project_order_task_fulfillments->removeElement($projectOrderTaskFulfillment)) {
  86.             // set the owning side to null (unless already changed)
  87.             if ($projectOrderTaskFulfillment->getReason() === $this) {
  88.                 $projectOrderTaskFulfillment->setReason(null);
  89.             }
  90.         }
  91.         return $this;
  92.     }
  93. }