src/Entity/ContractTypes.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContractTypesRepository;
  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=ContractTypesRepository::class)
  10.  */
  11. class ContractTypes
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({
  18.      *     "contract_type@base",
  19.      *     "contract_type@core"
  20.      * })
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="string", length=64)
  25.      * @Groups({
  26.      *      "contract_type@base",
  27.      *      "contract_type@core"
  28.      *  })
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=ProjectOrderTaskFulfillment::class, mappedBy="contract_type")
  33.      */
  34.     private $project_order_task_fulfillments;
  35.     public function __construct()
  36.     {
  37.         $this->project_order_task_fulfillments = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): self
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, ProjectOrderTaskFulfillment>
  54.      */
  55.     public function getProjectOrderTaskFulfillments(): Collection
  56.     {
  57.         return $this->project_order_task_fulfillments;
  58.     }
  59.     public function addProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  60.     {
  61.         if (!$this->project_order_task_fulfillments->contains($projectOrderTaskFulfillment)) {
  62.             $this->project_order_task_fulfillments[] = $projectOrderTaskFulfillment;
  63.             $projectOrderTaskFulfillment->setContractType($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
  68.     {
  69.         if ($this->project_order_task_fulfillments->removeElement($projectOrderTaskFulfillment)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($projectOrderTaskFulfillment->getContractType() === $this) {
  72.                 $projectOrderTaskFulfillment->setContractType(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77. }