<?phpnamespace App\Entity;use App\Repository\AffiliateClientRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: AffiliateClientRepository::class)]class AffiliateClient{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\ManyToOne(targetEntity: AccountingFirm::class, inversedBy: 'affiliateClients')] private $accountingFirm; #[ORM\ManyToOne(targetEntity: Affiliate::class, inversedBy: 'affiliateClients')] private $affiliate; #[ORM\OneToMany(mappedBy: 'affiliateClient', targetEntity: AffiliateClientService::class, cascade: ['persist', 'remove'], orphanRemoval: true)] private $services; #[ORM\Column(type: 'datetime')] private $dateStartAffiliate; #[ORM\Column(type: 'datetime')] private $dateLastInvoice; public function __construct() { $this->services = new ArrayCollection(); $dateLastInvoice = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getAccountingFirm(): ?AccountingFirm { return $this->accountingFirm; } public function setAccountingFirm(?AccountingFirm $accountingFirm): self { $this->accountingFirm = $accountingFirm; return $this; } public function getAffiliate(): ?Affiliate { return $this->affiliate; } public function setAffiliate(?Affiliate $affiliate): self { $this->affiliate = $affiliate; return $this; } /** * @return Collection<int, AffiliateClientService> */ public function getServices(): Collection { return $this->services; } public function addService(AffiliateClientService $service): self { if (!$this->services->contains($service)) { $this->services[] = $service; $service->setAffiliateClient($this); } return $this; } public function removeService(AffiliateClientService $service): self { if ($this->services->removeElement($service)) { // set the owning side to null (unless already changed) if ($service->getAffiliateClient() === $this) { $service->setAffiliateClient(null); } } return $this; } public function getDateStartAffiliate(): ?\DateTimeInterface { return $this->dateStartAffiliate; } public function setDateStartAffiliate(\DateTimeInterface $dateStartAffiliate): self { $this->dateStartAffiliate = $dateStartAffiliate; return $this; } public function getDateLastInvoice(): ?\DateTimeInterface { return $this->dateLastInvoice; } public function setDateLastInvoice(\DateTimeInterface $dateLastInvoice): self { $this->dateLastInvoice = $dateLastInvoice; return $this; }}