<?php
namespace App\Entity;
use App\Repository\ContractTypesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=ContractTypesRepository::class)
*/
class ContractTypes
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({
* "contract_type@base",
* "contract_type@core"
* })
*/
private $id;
/**
* @ORM\Column(type="string", length=64)
* @Groups({
* "contract_type@base",
* "contract_type@core"
* })
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=ProjectOrderTaskFulfillment::class, mappedBy="contract_type")
*/
private $project_order_task_fulfillments;
public function __construct()
{
$this->project_order_task_fulfillments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, ProjectOrderTaskFulfillment>
*/
public function getProjectOrderTaskFulfillments(): Collection
{
return $this->project_order_task_fulfillments;
}
public function addProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
{
if (!$this->project_order_task_fulfillments->contains($projectOrderTaskFulfillment)) {
$this->project_order_task_fulfillments[] = $projectOrderTaskFulfillment;
$projectOrderTaskFulfillment->setContractType($this);
}
return $this;
}
public function removeProjectOrderTaskFulfillment(ProjectOrderTaskFulfillment $projectOrderTaskFulfillment): self
{
if ($this->project_order_task_fulfillments->removeElement($projectOrderTaskFulfillment)) {
// set the owning side to null (unless already changed)
if ($projectOrderTaskFulfillment->getContractType() === $this) {
$projectOrderTaskFulfillment->setContractType(null);
}
}
return $this;
}
}