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.      * K8 (2026-08-10) — reference-lookup icin dogal anahtar; ikinci kez ayni alias
  25.      * ile satir acilmasin diye UNIQUE.
  26.      * @ORM\Column(type="string", length=64, unique=true)
  27.      * @Groups({
  28.      *     "task_fulfillment_reason@base",
  29.      *     "task_fulfillment_reason@core"
  30.      * })
  31.      */
  32.     private $alias;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      * @Groups({
  36.      *       "task_fulfillment_reason@core"
  37.      *   })
  38.      */
  39.     private $description;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=ProjectOrderTaskFulfillment::class, mappedBy="reason")
  42.      */
  43.     private $project_order_task_fulfillments;
  44.     public function __construct()
  45.     {
  46.         $this->project_order_task_fulfillments = new ArrayCollection();
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getAlias(): ?string
  53.     {
  54.         return $this->alias;
  55.     }
  56.     public function setAlias(string $alias): self
  57.     {
  58.         $this->alias $alias;
  59.         return $this;
  60.     }
  61.     public function getDescription(): ?string
  62.     {
  63.         return $this->description;
  64.     }
  65.     public function setDescription(?string $description): self
  66.     {
  67.         $this->description $description;
  68.         return $this;
  69.     }
  70.     /**
  71.      * @return Collection<int, ProjectOrderTaskFulfillment>
  72.      */
  73.     public function getProjectOrderTaskFulfillments(): Collection
  74.     {
  75.         return $this->project_order_task_fulfillments;
  76.     }
  77.     public function addProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  78.     {
  79.         if (!$this->project_order_task_fulfillments->contains($projectOrderTaskFulfillment)) {
  80.             $this->project_order_task_fulfillments[] = $projectOrderTaskFulfillment;
  81.             $projectOrderTaskFulfillment->setReason($this);
  82.         }
  83.         return $this;
  84.     }
  85.     public function removeProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  86.     {
  87.         if ($this->project_order_task_fulfillments->removeElement($projectOrderTaskFulfillment)) {
  88.             // set the owning side to null (unless already changed)
  89.             if ($projectOrderTaskFulfillment->getReason() === $this) {
  90.                 $projectOrderTaskFulfillment->setReason(null);
  91.             }
  92.         }
  93.         return $this;
  94.     }
  95. }