src/Entity/CRM/Agreement.php line 12
<?phpnamespace App\Entity\CRM;use App\Entity\CRM\Product;use App\Repository\AgreementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: AgreementRepository::class)]class Agreement{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $url = null;#[ORM\OneToMany(mappedBy: 'agreement', targetEntity: Product::class)]private Collection $products;#[ORM\Column(length: 255)]private ?string $type = null;#[ORM\ManyToMany(targetEntity: Admin::class, inversedBy: 'agreementsToSendAfterSigned')]private Collection $agreementToSendAfterSigned;#[ORM\Column]private ?bool $indefiniteDuration = null;#[ORM\OneToMany(mappedBy: 'agreement', targetEntity: AgreementContractTemplateSet::class)]private Collection $agreementContractTemplateSets;public function __construct(){$this->products = new ArrayCollection();$this->agreementToSendAfterSigned = new ArrayCollection();$this->indefiniteDuration = false;$this->agreementContractTemplateSets = new ArrayCollection();}public function __toString(): string{return $this->name;}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getUrl(): ?string{return $this->url;}public function setUrl(string $url): static{$this->url = $url;return $this;}/*** @return Collection<int, Product>*/public function getProducts(): Collection{return $this->products;}public function addProduct(Product $product): static{if (!$this->products->contains($product)) {$this->products->add($product);$product->setAgreement($this);}return $this;}public function removeProduct(Product $product): static{if ($this->products->removeElement($product)) {// set the owning side to null (unless already changed)if ($product->getAgreement() === $this) {$product->setAgreement(null);}}return $this;}public function getType(): ?string{return $this->type;}public function setType(string $type): static{$this->type = $type;return $this;}/*** @return Collection<int, Admin>*/public function getAgreementToSendAfterSigned(): Collection{return $this->agreementToSendAfterSigned;}public function addAgreementToSendAfterSigned(Admin $agreementToSendAfterSigned): static{if (!$this->agreementToSendAfterSigned->contains($agreementToSendAfterSigned)) {$this->agreementToSendAfterSigned->add($agreementToSendAfterSigned);}return $this;}public function removeAgreementToSendAfterSigned(Admin $agreementToSendAfterSigned): static{$this->agreementToSendAfterSigned->removeElement($agreementToSendAfterSigned);return $this;}/*** @return Collection<int, AgreementContractTemplateSet>*/public function getAgreementContractTemplateSets(): Collection{return $this->agreementContractTemplateSets;}public function addAgreementContractTemplateSet(AgreementContractTemplateSet $agreementContractTemplateSet): static{if (!$this->agreementContractTemplateSets->contains($agreementContractTemplateSet)) {$this->agreementContractTemplateSets->add($agreementContractTemplateSet);$agreementContractTemplateSet->setAgreement($this);}return $this;}public function removeAgreementContractTemplateSet(AgreementContractTemplateSet $agreementContractTemplateSet): static{if ($this->agreementContractTemplateSets->removeElement($agreementContractTemplateSet)) {// set the owning side to null (unless already changed)if ($agreementContractTemplateSet->getAgreement() === $this) {$agreementContractTemplateSet->setAgreement(null);}}return $this;}public function isIndefiniteDuration(): ?bool{return $this->indefiniteDuration;}public function setIndefiniteDuration(bool $indefiniteDuration): static{$this->indefiniteDuration = $indefiniteDuration;return $this;}}