src/Entity/AffiliateClient.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AffiliateClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassAffiliateClientRepository::class)]
  8. class AffiliateClient
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityAccountingFirm::class, inversedBy'affiliateClients')]
  15.     private $accountingFirm;
  16.     #[ORM\ManyToOne(targetEntityAffiliate::class, inversedBy'affiliateClients')]
  17.     private $affiliate;
  18.     #[ORM\OneToMany(mappedBy'affiliateClient'targetEntityAffiliateClientService::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  19.     private $services;
  20.     #[ORM\Column(type'datetime')]
  21.     private $dateStartAffiliate;
  22.     #[ORM\Column(type'datetime')]
  23.     private $dateLastInvoice;
  24.     public function __construct()
  25.     {
  26.         $this->services = new ArrayCollection();
  27.         $dateLastInvoice = new \DateTime();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getAccountingFirm(): ?AccountingFirm
  34.     {
  35.         return $this->accountingFirm;
  36.     }
  37.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self
  38.     {
  39.         $this->accountingFirm $accountingFirm;
  40.         return $this;
  41.     }
  42.     public function getAffiliate(): ?Affiliate
  43.     {
  44.         return $this->affiliate;
  45.     }
  46.     public function setAffiliate(?Affiliate $affiliate): self
  47.     {
  48.         $this->affiliate $affiliate;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection<int, AffiliateClientService>
  53.      */
  54.     public function getServices(): Collection
  55.     {
  56.         return $this->services;
  57.     }
  58.     public function addService(AffiliateClientService $service): self
  59.     {
  60.         if (!$this->services->contains($service)) {
  61.             $this->services[] = $service;
  62.             $service->setAffiliateClient($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeService(AffiliateClientService $service): self
  67.     {
  68.         if ($this->services->removeElement($service)) {
  69.             // set the owning side to null (unless already changed)
  70.             if ($service->getAffiliateClient() === $this) {
  71.                 $service->setAffiliateClient(null);
  72.             }
  73.         }
  74.         return $this;
  75.     }
  76.     public function getDateStartAffiliate(): ?\DateTimeInterface
  77.     {
  78.         return $this->dateStartAffiliate;
  79.     }
  80.     public function setDateStartAffiliate(\DateTimeInterface $dateStartAffiliate): self
  81.     {
  82.         $this->dateStartAffiliate $dateStartAffiliate;
  83.         return $this;
  84.     }
  85.   public function getDateLastInvoice(): ?\DateTimeInterface
  86.   {
  87.     return $this->dateLastInvoice;
  88.   }
  89.   public function setDateLastInvoice(\DateTimeInterface $dateLastInvoice): self
  90.   {
  91.     $this->dateLastInvoice $dateLastInvoice;
  92.     return $this;
  93.   }
  94. }