src/Entity/Partner/Partner.php line 43

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Partner;
  3. use App\Annotation\__Partner\CreatePartnerFormValidator;
  4. use App\Annotation\__Partner\PartnerWebsiteManagementFormValidator;
  5. use App\Annotation\__Partner\UpdatePartnerFormValidator;
  6. use App\Entity\__Accounting\PartnerAllowance\Allowance;
  7. use App\Entity\__Accounting\PartnerAllowance\PartnerAllowance;
  8. use App\Entity\__Accounting\PartnerParticipation\Participation;
  9. use App\Entity\__Accounting\PartnerParticipation\PartnerParticipation;
  10. use App\Entity\__Accounting\PartnerTemplate\PartnerTemplate;
  11. use App\Entity\ApplicationFilter;
  12. use App\Entity\Booking\BookingPartnerTurnover;
  13. use App\Entity\Booking\ProspectRequest;
  14. use App\Entity\Booking\Quote;
  15. use App\Entity\Booking\QuoteParticipant;
  16. use App\Entity\Cruise\Cruise\CruiseTag;
  17. use App\Entity\Cruise\Cruise\CruiseTagAssociationHistory;
  18. use App\Entity\Discount\AttributedDiscount;
  19. use App\Entity\Selling\SellingSegment;
  20. use Crea\ToolsBundle\Entity\Geographic\Address;
  21. use Crea\ToolsBundle\Entity\LifecycleTrait;
  22. use Croisiland\CommonBundle\Model\AbstractPartner;
  23. use DateTimeInterface;
  24. use Doctrine\Common\Collections\ArrayCollection;
  25. use Doctrine\Common\Collections\Collection;
  26. use Doctrine\ORM\Mapping as ORM;
  27. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  28. /**
  29.  * @ORM\Entity(repositoryClass="App\Repository\Partner\PartnerRepository")
  30.  * @UniqueEntity(
  31.  *      fields={"name"},
  32.  *      errorPath="name",
  33.  *      message="partner.name.unique_constraint",
  34.  *      ignoreNull=true,
  35.  *  )
  36.  * @PartnerWebsiteManagementFormValidator(groups={"partner_website_management_form_validator"})
  37.  * @CreatePartnerFormValidator(groups={"create_partner_form_validator"})
  38.  * @UpdatePartnerFormValidator(groups={"update_partner_form_validator"})
  39.  */
  40. class Partner extends AbstractPartner
  41. {
  42.     use LifeCycleTrait;
  43.     /**
  44.      * @var Collection|PartnerByContact[]
  45.      *
  46.      * @ORM\OneToMany(targetEntity=PartnerByContact::class, mappedBy="partner")
  47.      */
  48.     private $partnerByContacts;
  49.     /**
  50.      * @var Collection|PartnerByContactHistory[]
  51.      *
  52.      * @ORM\OneToMany(targetEntity=PartnerByContactHistory::class, mappedBy="partner")
  53.      */
  54.     private $partnerByContactHistories;
  55.     /**
  56.      * @ORM\OneToOne(targetEntity=Address::class, cascade={"all"}, orphanRemoval=true)
  57.      */
  58.     private ?Address $address null;
  59.     /**
  60.      * @var Collection|ContactPartner[]
  61.      *
  62.      * @ORM\OneToMany(targetEntity=ContactPartner::class, mappedBy="partner", cascade={"persist", "remove"})
  63.      */
  64.     private $contactPartners;
  65.     /**
  66.      * @var Collection|PartnerCompanyDiscount[]
  67.      *
  68.      * @ORM\OneToMany(targetEntity=PartnerCompanyDiscount::class, mappedBy="partner")
  69.      * @ORM\OrderBy({"company" = "ASC", "cabinType" = "ASC"})
  70.      */
  71.     private $partnerCompanyDiscounts;
  72.     /**
  73.      * @var Collection|PartnerFollowUp[]
  74.      *
  75.      * @ORM\OneToMany(targetEntity=PartnerFollowUp::class, mappedBy="partner")
  76.      */
  77.     private $partnerFollowUps;
  78.     /**
  79.      * @var Collection|Quote[]
  80.      *
  81.      * @ORM\OneToMany(targetEntity=Quote::class, mappedBy="partner")
  82.      */
  83.     private $quotes;
  84.     /**
  85.      * @var Collection|QuoteParticipant[]
  86.      *
  87.      * @ORM\OneToMany(targetEntity=QuoteParticipant::class, mappedBy="partner")
  88.      */
  89.     private $quoteParticipants;
  90.     /**
  91.      * @var Collection|AttributedDiscount[]
  92.      *
  93.      * @ORM\OneToMany(targetEntity=AttributedDiscount::class, mappedBy="partner", orphanRemoval=true, cascade={"persist", "remove"})
  94.      */
  95.     private $attributedDiscounts;
  96.     /**
  97.      * @var Collection|ApplicationFilter[]
  98.      *
  99.      * @ORM\ManyToMany(targetEntity=ApplicationFilter::class, mappedBy="partners")
  100.      */
  101.     private $applicationFilters;
  102.     /**
  103.      * @ORM\ManyToOne(targetEntity=SellingSegment::class, inversedBy="partners")
  104.      * @ORM\JoinColumn(nullable=true)
  105.      */
  106.     private ?SellingSegment $sellingSegment null;
  107.     /**
  108.      * @var Collection|CruiseTag[]
  109.      *
  110.      * @ORM\ManyToMany(targetEntity=CruiseTag::class, mappedBy="partners")
  111.      */
  112.     private Collection $cruiseTags;
  113.     /**
  114.      * @var Collection|CruiseTagAssociationHistory[]
  115.      *
  116.      * @ORM\OneToMany(targetEntity=CruiseTagAssociationHistory::class, mappedBy="partner")
  117.      */
  118.     private Collection $cruiseTagAssociationHistories;
  119.     /**
  120.      * @var Collection|ProspectRequest[]
  121.      *
  122.      * @ORM\OneToMany(targetEntity=ProspectRequest::class, mappedBy="partner")
  123.      */
  124.     private Collection $prospectRequests;
  125.     /**
  126.      * @ORM\Column(type="boolean", options={"default":0})
  127.      */
  128.     protected bool $showLogo false;
  129.     /**
  130.      * @ORM\Column(type="boolean", options={"default":0})
  131.      */
  132.     protected bool $payer false;
  133.     /**
  134.      * @ORM\Column(type="datetime", nullable=true)
  135.      */
  136.     protected ?DateTimeInterface $closingDate null;
  137.     /**
  138.      * @ORM\Column(type="text", nullable=true)
  139.      */
  140.     protected ?string $closingDateNote null;
  141.     /**
  142.      * @ORM\Column(type="text", nullable=true)
  143.      */
  144.     protected ?string $comment null;
  145.     /**
  146.      * @ORM\Column(type="string", length=255, nullable=true)
  147.      */
  148.     protected ?string $partnerSiteUrl null;
  149.     /**
  150.      * @ORM\Column(type="string", length=255, nullable=true)
  151.      */
  152.     protected ?string $partnerSiteLogin null;
  153.     /**
  154.      * @ORM\Column(type="string", length=255, nullable=true)
  155.      */
  156.     protected ?string $partnerSiteComment null;
  157.     /**
  158.      * @ORM\Column(type="datetime", nullable=true)
  159.      */
  160.     protected ?DateTimeInterface $deactivationDate null;
  161.     /**
  162.      * @ORM\Column(type="integer", nullable=true)
  163.      */
  164.     protected ?int $currentSize null;
  165.     /**
  166.      * @ORM\Column(type="boolean", options={"default":0})
  167.      */
  168.     protected bool $hasContacts false;
  169.     /********************************** Accounting ********************************************************************/
  170.     /**
  171.      * @var Collection|Allowance[]
  172.      *
  173.      * @ORM\OneToMany(targetEntity=Allowance::class, mappedBy="partner", cascade={"remove", "persist"}, orphanRemoval=true)
  174.      */
  175.     private $allowances;
  176.     /**
  177.      * @var Collection|PartnerAllowance[]
  178.      *
  179.      * @ORM\OneToMany(targetEntity=PartnerAllowance::class, mappedBy="partner", cascade={"remove", "persist"}, orphanRemoval=true)
  180.      */
  181.     private $partnerAllowances;
  182.     /**
  183.      * @var Collection|Participation[]
  184.      *
  185.      * @ORM\OneToMany(targetEntity=Participation::class, mappedBy="partner", cascade={"remove", "persist"}, orphanRemoval=true)
  186.      */
  187.     private $participations;
  188.     /**
  189.      * @var Collection|PartnerParticipation[]
  190.      *
  191.      * @ORM\OneToMany(targetEntity=PartnerParticipation::class, mappedBy="partner", cascade={"remove", "persist"}, orphanRemoval=true)
  192.      */
  193.     private $partnerParticipations;
  194.     /**
  195.      * @var Collection|BookingPartnerTurnover[]
  196.      *
  197.      * @ORM\OneToMany(targetEntity=BookingPartnerTurnover::class, mappedBy="partner", cascade={"remove", "persist"}, orphanRemoval=true)
  198.      */
  199.     private $bookingPartnerTurnovers;
  200.     /**
  201.      * @ORM\Column(type="float", nullable=true)
  202.      */
  203.     protected ?float $currentYearTurnover null;
  204.     /**
  205.      * @ORM\Column(type="float", nullable=true)
  206.      */
  207.     protected ?float $previousYearTurnover null;
  208.     /**
  209.      * @var Collection|PartnerTemplate[]
  210.      *
  211.      * @ORM\OneToMany(targetEntity=PartnerTemplate::class, mappedBy="partner", cascade={"remove", "persist"}, orphanRemoval=true)
  212.      */
  213.     private $partnerTemplates;
  214.     public function __construct()
  215.     {
  216.         parent::__construct();
  217.         $this->partnerByContacts = new ArrayCollection();
  218.         $this->partnerByContactHistories = new ArrayCollection();
  219.         $this->contactPartners = new ArrayCollection();
  220.         $this->partnerCompanyDiscounts = new ArrayCollection();
  221.         $this->partnerFollowUps = new ArrayCollection();
  222.         $this->quotes = new ArrayCollection();
  223.         $this->quoteParticipants = new ArrayCollection();
  224.         $this->attributedDiscounts = new ArrayCollection();
  225.         $this->applicationFilters = new ArrayCollection();
  226.         $this->cruiseTags = new ArrayCollection();
  227.         $this->cruiseTagAssociationHistories = new ArrayCollection();
  228.         $this->prospectRequests = new ArrayCollection();
  229.         $this->allowances = new ArrayCollection();
  230.         $this->partnerAllowances = new ArrayCollection();
  231.         $this->participations = new ArrayCollection();
  232.         $this->partnerParticipations = new ArrayCollection();
  233.         $this->bookingPartnerTurnovers = new ArrayCollection();
  234.         $this->partnerTemplates = new ArrayCollection();
  235.     }
  236.     public function setId(int $id): self
  237.     {
  238.         $this->id $id;
  239.         return $this;
  240.     }
  241.     /**
  242.      * @return Collection|PartnerByContact[]
  243.      */
  244.     public function getPartnerByContacts(): Collection
  245.     {
  246.         return $this->partnerByContacts;
  247.     }
  248.     public function addPartnerByContact(PartnerByContact $partnerByContact): self
  249.     {
  250.         if (!$this->partnerByContacts->contains($partnerByContact)) {
  251.             $this->partnerByContacts[] = $partnerByContact;
  252.             $partnerByContact->setPartner($this);
  253.         }
  254.         return $this;
  255.     }
  256.     /**
  257.      * @return PartnerByContactHistory[]|Collection
  258.      */
  259.     public function getPartnerByContactHistories()
  260.     {
  261.         return $this->partnerByContactHistories;
  262.     }
  263.     /**
  264.      * @param PartnerByContactHistory[]|Collection $partnerByContactHistories
  265.      * @return Partner
  266.      */
  267.     public function setPartnerByContactHistories($partnerByContactHistories): self
  268.     {
  269.         $this->partnerByContactHistories $partnerByContactHistories;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @param PartnerByContactHistory $partnerByContactHistory
  274.      * @return Partner
  275.      */
  276.     public function addPartnerByContactHistory(PartnerByContactHistory $partnerByContactHistory): self
  277.     {
  278.         if (!$this->partnerByContactHistories->contains($partnerByContactHistory)) {
  279.             $this->partnerByContactHistories[] = $partnerByContactHistory;
  280.             $partnerByContactHistory->setPartner($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function getAddress(): ?Address
  285.     {
  286.         return $this->address;
  287.     }
  288.     public function setAddress(?Address $address): self
  289.     {
  290.         $this->address $address;
  291.         return $this;
  292.     }
  293.     /**
  294.      * @return Collection|ContactPartner[]
  295.      */
  296.     public function getContactPartners(): Collection
  297.     {
  298.         return $this->contactPartners;
  299.     }
  300.     public function addContactPartner(ContactPartner $contactPartner): self
  301.     {
  302.         if (!$this->contactPartners->contains($contactPartner)) {
  303.             $this->contactPartners[] = $contactPartner;
  304.             $contactPartner->setPartner($this);
  305.         }
  306.         return $this;
  307.     }
  308.     public function removeContactPartner(ContactPartner $contactPartner): self
  309.     {
  310.         if ($this->contactPartners->removeElement($contactPartner)) {
  311.             // set the owning side to null (unless already changed)
  312.             if ($contactPartner->getPartner() === $this) {
  313.                 $contactPartner->setPartner(null);
  314.             }
  315.         }
  316.         return $this;
  317.     }
  318.     /**
  319.      * @return Collection|PartnerCompanyDiscount[]
  320.      */
  321.     public function getPartnerCompanyDiscounts(): Collection
  322.     {
  323.         return $this->partnerCompanyDiscounts;
  324.     }
  325.     public function addPartnerCompanyDiscount(PartnerCompanyDiscount $partnerCompanyDiscount): self
  326.     {
  327.         if (!$this->partnerCompanyDiscounts->contains($partnerCompanyDiscount)) {
  328.             $this->partnerCompanyDiscounts[] = $partnerCompanyDiscount;
  329.             $partnerCompanyDiscount->setPartner($this);
  330.         }
  331.         return $this;
  332.     }
  333.     public function removePartnerCompanyDiscount(PartnerCompanyDiscount $partnerCompanyDiscount): self
  334.     {
  335.         if ($this->partnerCompanyDiscounts->removeElement($partnerCompanyDiscount)) {
  336.             // set the owning side to null (unless already changed)
  337.             if ($partnerCompanyDiscount->getPartner() === $this) {
  338.                 $partnerCompanyDiscount->setPartner(null);
  339.             }
  340.         }
  341.         return $this;
  342.     }
  343.     /**
  344.      * @return Collection|PartnerFollowUp[]
  345.      */
  346.     public function getPartnerFollowUps(): Collection
  347.     {
  348.         return $this->partnerFollowUps;
  349.     }
  350.     public function addPartnerFollowUp(PartnerFollowUp $partnerFollowUp): self
  351.     {
  352.         if (!$this->partnerFollowUps->contains($partnerFollowUp)) {
  353.             $this->partnerFollowUps[] = $partnerFollowUp;
  354.             $partnerFollowUp->setPartner($this);
  355.         }
  356.         return $this;
  357.     }
  358.     public function removePartnerFollowUp(PartnerFollowUp $partnerFollowUp): self
  359.     {
  360.         if ($this->partnerFollowUps->removeElement($partnerFollowUp)) {
  361.             // set the owning side to null (unless already changed)
  362.             if ($partnerFollowUp->getPartner() === $this) {
  363.                 $partnerFollowUp->setPartner(null);
  364.             }
  365.         }
  366.         return $this;
  367.     }
  368.     public function getTurnover(): float
  369.     {
  370.         $turnover 0;
  371.         foreach ($this->getPartnerByContacts() as $partnerByContact) {
  372.             foreach ($partnerByContact->getContact()->getParticipants() as $participant) {
  373.                 if ($participant->getBooking() && $participant->getBooking()->getContract()) {
  374.                     $turnover += (float) $participant->getBooking()->getContract()->getInvoicesWithoutDiscountsAmount();
  375.                 }
  376.             }
  377.         }
  378.         return $turnover;
  379.     }
  380.     public function getBookingCount(): int
  381.     {
  382.         $count 0;
  383.         foreach ($this->getPartnerByContacts() as $partnerByContact) {
  384.             $count += count($partnerByContact->getContact()->getParticipants());
  385.         }
  386.         return $count;
  387.     }
  388.     /**
  389.      * @return Collection|Quote[]
  390.      */
  391.     public function getQuotes(): Collection
  392.     {
  393.         return $this->quotes;
  394.     }
  395.     public function addQuote(Quote $quote): self
  396.     {
  397.         if (!$this->quotes->contains($quote)) {
  398.             $this->quotes[] = $quote;
  399.             $quote->setPartner($this);
  400.         }
  401.         return $this;
  402.     }
  403.     public function removeQuote(Quote $quote): self
  404.     {
  405.         if ($this->quotes->removeElement($quote)) {
  406.             // set the owning side to null (unless already changed)
  407.             if ($quote->getPartner() === $this) {
  408.                 $quote->setPartner(null);
  409.             }
  410.         }
  411.         return $this;
  412.     }
  413.     public function getQuoteParticipants(): Collection
  414.     {
  415.         return $this->quoteParticipants;
  416.     }
  417.     public function addQuoteParticipant(QuoteParticipant $quoteParticipant): self
  418.     {
  419.         if (!$this->quoteParticipants->contains($quoteParticipant)) {
  420.             $this->quoteParticipants[] = $quoteParticipant;
  421.             $quoteParticipant->setPartner($this);
  422.         }
  423.         return $this;
  424.     }
  425.     public function removeQuoteParticipant(QuoteParticipant $quoteParticipant): self
  426.     {
  427.         if ($this->quoteParticipants->removeElement($quoteParticipant)) {
  428.             // set the owning side to null (unless already changed)
  429.             if ($quoteParticipant->getPartner() === $this) {
  430.                 $quoteParticipant->setPartner(null);
  431.             }
  432.         }
  433.         return $this;
  434.     }
  435.     public function getAttributedDiscounts(): Collection
  436.     {
  437.         return $this->attributedDiscounts;
  438.     }
  439.     public function addAttributedDiscount(AttributedDiscount $attributedDiscount): self
  440.     {
  441.         if (!$this->attributedDiscounts->contains($attributedDiscount)) {
  442.             $this->attributedDiscounts[] = $attributedDiscount;
  443.             $attributedDiscount->setPartner($this);
  444.         }
  445.         return $this;
  446.     }
  447.     public function removeAttributedDiscount(AttributedDiscount $attributedDiscount): self
  448.     {
  449.         if ($this->attributedDiscounts->removeElement($attributedDiscount)) {
  450.             // set the owning side to null (unless already changed)
  451.             if ($attributedDiscount->getPartner() === $this) {
  452.                 $attributedDiscount->setPartner(null);
  453.             }
  454.         }
  455.         return $this;
  456.     }
  457.     /**
  458.      * @return Collection|ApplicationFilter[]
  459.      */
  460.     public function getApplicationFilters(): Collection
  461.     {
  462.         return $this->applicationFilters;
  463.     }
  464.     public function addApplicationFilter(ApplicationFilter $applicationFilter): self
  465.     {
  466.         if (!$this->applicationFilters->contains($applicationFilter)) {
  467.             $this->applicationFilters[] = $applicationFilter;
  468.         }
  469.         return $this;
  470.     }
  471.     public function removeApplicationFilter(ApplicationFilter $applicationFilter): self
  472.     {
  473.         $this->applicationFilters->removeElement($applicationFilter);
  474.         return $this;
  475.     }
  476.     public function getSellingSegment(): ?SellingSegment
  477.     {
  478.         return $this->sellingSegment;
  479.     }
  480.     public function setSellingSegment(?SellingSegment $sellingSegment): self
  481.     {
  482.         $this->sellingSegment $sellingSegment;
  483.         return $this;
  484.     }
  485.     public function getCruiseTags(): Collection
  486.     {
  487.         return $this->cruiseTags;
  488.     }
  489.     public function setCruiseTags(Collection $cruiseTags): self
  490.     {
  491.         $this->cruiseTags $cruiseTags;
  492.         return $this;
  493.     }
  494.     /**
  495.      * @param CruiseTag $cruiseTag
  496.      * @return Partner
  497.      */
  498.     public function addCruiseTag(CruiseTag $cruiseTag): self
  499.     {
  500.         if (!$this->cruiseTags->contains($cruiseTag)) {
  501.             $this->cruiseTags[] = $cruiseTag;
  502.         }
  503.         return $this;
  504.     }
  505.     /**
  506.      * @param CruiseTag $cruiseTag
  507.      * @return Partner
  508.      */
  509.     public function removeCruiseTag(CruiseTag $cruiseTag): self
  510.     {
  511.         $this->cruiseTags->removeElement($cruiseTag);
  512.         return $this;
  513.     }
  514.     public function getCruiseTagAssociationHistories(): Collection
  515.     {
  516.         return $this->cruiseTagAssociationHistories;
  517.     }
  518.     public function setCruiseTagAssociationHistories(Collection $cruiseTagAssociationHistories): self
  519.     {
  520.         $this->cruiseTagAssociationHistories $cruiseTagAssociationHistories;
  521.         return $this;
  522.     }
  523.     /**
  524.      * @param CruiseTagAssociationHistory $cruiseTagAssociationHistory
  525.      * @return Partner
  526.      */
  527.     public function addCruiseTagAssociationHistory(CruiseTagAssociationHistory $cruiseTagAssociationHistory): self
  528.     {
  529.         if (!$this->cruiseTagAssociationHistories->contains($cruiseTagAssociationHistory)) {
  530.             $this->cruiseTagAssociationHistories[] = $cruiseTagAssociationHistory;
  531.             $cruiseTagAssociationHistory->setPartner($this);
  532.         }
  533.         return $this;
  534.     }
  535.     /**
  536.      * @param CruiseTagAssociationHistory $cruiseTagAssociationHistory
  537.      * @return Partner
  538.      */
  539.     public function removeCruiseTagAssociationHistory(CruiseTagAssociationHistory $cruiseTagAssociationHistory): self
  540.     {
  541.         if ($this->cruiseTagAssociationHistories->removeElement($cruiseTagAssociationHistory)) {
  542.             if ($cruiseTagAssociationHistory->getPartner() === $this) {
  543.                 $cruiseTagAssociationHistory->setPartner(null);
  544.             }
  545.         }
  546.         return $this;
  547.     }
  548.     public function getProspectRequests(): Collection
  549.     {
  550.         return $this->prospectRequests;
  551.     }
  552.     public function setProspectRequests(Collection $prospectRequests): self
  553.     {
  554.         $this->prospectRequests $prospectRequests;
  555.         return $this;
  556.     }
  557.     /**
  558.      * @param ProspectRequest $prospectRequest
  559.      * @return Partner
  560.      */
  561.     public function addProspectRequest(ProspectRequest $prospectRequest): self
  562.     {
  563.         if (!$this->prospectRequests->contains($prospectRequest)) {
  564.             $this->prospectRequests[] = $prospectRequest;
  565.             $prospectRequest->setPartner($this);
  566.         }
  567.         return $this;
  568.     }
  569.     /**
  570.      * @param ProspectRequest $prospectRequest
  571.      * @return Partner
  572.      */
  573.     public function removeProspectRequest(ProspectRequest $prospectRequest): self
  574.     {
  575.         if ($this->prospectRequests->removeElement($prospectRequest)) {
  576.             if ($prospectRequest->getPartner() === $this) {
  577.                 $prospectRequest->setPartner(null);
  578.             }
  579.         }
  580.         return $this;
  581.     }
  582.     /**
  583.      * @return bool
  584.      */
  585.     public function isShowLogo(): bool
  586.     {
  587.         return $this->showLogo;
  588.     }
  589.     /**
  590.      * @param bool $showLogo
  591.      * @return Partner
  592.      */
  593.     public function setShowLogo(bool $showLogo): Partner
  594.     {
  595.         $this->showLogo $showLogo;
  596.         return $this;
  597.     }
  598.     /**
  599.      * @return bool
  600.      */
  601.     public function isPayer(): bool
  602.     {
  603.         return $this->payer;
  604.     }
  605.     /**
  606.      * @param bool $payer
  607.      * @return Partner
  608.      */
  609.     public function setPayer(bool $payer): Partner
  610.     {
  611.         $this->payer $payer;
  612.         return $this;
  613.     }
  614.     /**
  615.      * @return DateTimeInterface|null
  616.      */
  617.     public function getClosingDate(): ?DateTimeInterface
  618.     {
  619.         return $this->closingDate;
  620.     }
  621.     /**
  622.      * @param DateTimeInterface|null $closingDate
  623.      * @return Partner
  624.      */
  625.     public function setClosingDate(?DateTimeInterface $closingDate): Partner
  626.     {
  627.         $this->closingDate $closingDate;
  628.         return $this;
  629.     }
  630.     /**
  631.      * @return string|null
  632.      */
  633.     public function getClosingDateNote(): ?string
  634.     {
  635.         return $this->closingDateNote;
  636.     }
  637.     /**
  638.      * @param string|null $closingDateNote
  639.      * @return Partner
  640.      */
  641.     public function setClosingDateNote(?string $closingDateNote): Partner
  642.     {
  643.         $this->closingDateNote $closingDateNote;
  644.         return $this;
  645.     }
  646.     /**
  647.      * @return string|null
  648.      */
  649.     public function getComment(): ?string
  650.     {
  651.         return $this->comment;
  652.     }
  653.     /**
  654.      * @param string|null $comment
  655.      * @return Partner
  656.      */
  657.     public function setComment(?string $comment): Partner
  658.     {
  659.         $this->comment $comment;
  660.         return $this;
  661.     }
  662.     /**
  663.      * @return string|null
  664.      */
  665.     public function getPartnerSiteUrl(): ?string
  666.     {
  667.         return $this->partnerSiteUrl;
  668.     }
  669.     /**
  670.      * @param string|null $partnerSiteUrl
  671.      * @return Partner
  672.      */
  673.     public function setPartnerSiteUrl(?string $partnerSiteUrl): Partner
  674.     {
  675.         $this->partnerSiteUrl $partnerSiteUrl;
  676.         return $this;
  677.     }
  678.     /**
  679.      * @return string|null
  680.      */
  681.     public function getPartnerSiteLogin(): ?string
  682.     {
  683.         return $this->partnerSiteLogin;
  684.     }
  685.     /**
  686.      * @param string|null $partnerSiteLogin
  687.      * @return Partner
  688.      */
  689.     public function setPartnerSiteLogin(?string $partnerSiteLogin): Partner
  690.     {
  691.         $this->partnerSiteLogin $partnerSiteLogin;
  692.         return $this;
  693.     }
  694.     /**
  695.      * @return string|null
  696.      */
  697.     public function getPartnerSiteComment(): ?string
  698.     {
  699.         return $this->partnerSiteComment;
  700.     }
  701.     /**
  702.      * @param string|null $partnerSiteComment
  703.      * @return Partner
  704.      */
  705.     public function setPartnerSiteComment(?string $partnerSiteComment): Partner
  706.     {
  707.         $this->partnerSiteComment $partnerSiteComment;
  708.         return $this;
  709.     }
  710.     /**
  711.      * @return DateTimeInterface|null
  712.      */
  713.     public function getDeactivationDate(): ?DateTimeInterface
  714.     {
  715.         return $this->deactivationDate;
  716.     }
  717.     /**
  718.      * @param DateTimeInterface|null $deactivationDate
  719.      * @return Partner
  720.      */
  721.     public function setDeactivationDate(?DateTimeInterface $deactivationDate): Partner
  722.     {
  723.         $this->deactivationDate $deactivationDate;
  724.         return $this;
  725.     }
  726.     /**
  727.      * @return int|null
  728.      */
  729.     public function getCurrentSize(): ?int
  730.     {
  731.         return $this->currentSize;
  732.     }
  733.     /**
  734.      * @param int|null $currentSize
  735.      * @return Partner
  736.      */
  737.     public function setCurrentSize(?int $currentSize): Partner
  738.     {
  739.         $this->currentSize $currentSize;
  740.         return $this;
  741.     }
  742.     /**
  743.      * @return bool
  744.      */
  745.     public function hasContacts(): bool
  746.     {
  747.         return $this->hasContacts;
  748.     }
  749.     /**
  750.      * @param bool $hasContacts
  751.      * @return Partner
  752.      */
  753.     public function setHasContacts(bool $hasContacts): Partner
  754.     {
  755.         $this->hasContacts $hasContacts;
  756.         return $this;
  757.     }
  758.     /**
  759.      * @return Allowance[]|Collection
  760.      */
  761.     public function getAllowances()
  762.     {
  763.         return $this->allowances;
  764.     }
  765.     /**
  766.      * @param Allowance[]|Collection $allowances
  767.      * @return Partner
  768.      */
  769.     public function setAllowances($allowances): self
  770.     {
  771.         $this->allowances $allowances;
  772.         return $this;
  773.     }
  774.     /**
  775.      * @param Allowance $allowance
  776.      * @return Partner
  777.      */
  778.     public function addAllowance(Allowance $allowance): self
  779.     {
  780.         if (!$this->allowances->contains($allowance)) {
  781.             $this->allowances[] = $allowance;
  782.             $allowance->setPartner($this);
  783.         }
  784.         return $this;
  785.     }
  786.     /**
  787.      * @param Allowance $allowance
  788.      * @return Partner
  789.      */
  790.     public function removeAllowance(Allowance $allowance): self
  791.     {
  792.         if ($this->allowances->removeElement($allowance)) {
  793.             if ($allowance->getPartner() === $this) {
  794.                 $allowance->setPartner(null);
  795.             }
  796.         }
  797.         return $this;
  798.     }
  799.     /**
  800.      * @return PartnerAllowance[]|Collection
  801.      */
  802.     public function getPartnerAllowances()
  803.     {
  804.         return $this->partnerAllowances;
  805.     }
  806.     /**
  807.      * @param PartnerAllowance[]|Collection $partnerAllowances
  808.      * @return Partner
  809.      */
  810.     public function setPartnerAllowances($partnerAllowances): self
  811.     {
  812.         $this->partnerAllowances $partnerAllowances;
  813.         return $this;
  814.     }
  815.     /**
  816.      * @param PartnerAllowance $partnerAllowance
  817.      * @return Partner
  818.      */
  819.     public function addPartnerAllowance(PartnerAllowance $partnerAllowance): self
  820.     {
  821.         if (!$this->partnerAllowances->contains($partnerAllowance)) {
  822.             $this->partnerAllowances->add($partnerAllowance);
  823.             $partnerAllowance->setPartner($this);
  824.         }
  825.         return $this;
  826.     }
  827.     /**
  828.      * @param PartnerAllowance $partnerAllowance
  829.      * @return Partner
  830.      */
  831.     public function removePartnerAllowance(PartnerAllowance $partnerAllowance): self
  832.     {
  833.         $this->partnerAllowances->removeElement($partnerAllowance);
  834.         return $this;
  835.     }
  836.     /**
  837.      * @return Participation[]|Collection
  838.      */
  839.     public function getParticipations()
  840.     {
  841.         return $this->participations;
  842.     }
  843.     /**
  844.      * @param Participation[]|Collection $participations
  845.      * @return Partner
  846.      */
  847.     public function setParticipations($participations): self
  848.     {
  849.         $this->participations $participations;
  850.         return $this;
  851.     }
  852.     /**
  853.      * @param Participation $participation
  854.      * @return Partner
  855.      */
  856.     public function addParticipation(Participation $participation): self
  857.     {
  858.         if (!$this->participations->contains($participation)) {
  859.             $this->participations->add($participation);
  860.             $participation->setPartner($this);
  861.         }
  862.         return $this;
  863.     }
  864.     /**
  865.      * @param Participation $participation
  866.      * @return Partner
  867.      */
  868.     public function removeParticipation(Participation $participation): self
  869.     {
  870.         if ($this->participations->removeElement($participation)) {
  871.             if ($participation->getPartner() === $this) {
  872.                 $participation->setPartner(null);
  873.             }
  874.         }
  875.         return $this;
  876.     }
  877.     /**
  878.      * @return PartnerParticipation[]|Collection
  879.      */
  880.     public function getPartnerParticipations()
  881.     {
  882.         return $this->partnerParticipations;
  883.     }
  884.     /**
  885.      * @param PartnerParticipation[]|Collection $partnerParticipations
  886.      * @return Partner
  887.      */
  888.     public function setPartnerParticipations($partnerParticipations): self
  889.     {
  890.         $this->partnerParticipations $partnerParticipations;
  891.         return $this;
  892.     }
  893.     /**
  894.      * @param PartnerParticipation $partnerParticipation
  895.      * @return Partner
  896.      */
  897.     public function addPartnerParticipation(PartnerParticipation $partnerParticipation): self
  898.     {
  899.         if (!$this->partnerParticipations->contains($partnerParticipation)) {
  900.             $this->partnerParticipations[] = $partnerParticipation;
  901.             $partnerParticipation->setPartner($this);
  902.         }
  903.         return $this;
  904.     }
  905.     /**
  906.      * @param PartnerParticipation $partnerParticipation
  907.      * @return Partner
  908.      */
  909.     public function removePartnerParticipation(PartnerParticipation $partnerParticipation): self
  910.     {
  911.         $this->partnerParticipations->removeElement($partnerParticipation);
  912.         return $this;
  913.     }
  914.     /**
  915.      * @return BookingPartnerTurnover[]|Collection
  916.      */
  917.     public function getBookingPartnerTurnovers()
  918.     {
  919.         return $this->bookingPartnerTurnovers;
  920.     }
  921.     /**
  922.      * @param BookingPartnerTurnover[]|Collection $bookingPartnerTurnovers
  923.      * @return Partner
  924.      */
  925.     public function setBookingPartnerTurnovers($bookingPartnerTurnovers): self
  926.     {
  927.         $this->bookingPartnerTurnovers $bookingPartnerTurnovers;
  928.         return $this;
  929.     }
  930.     /**
  931.      * @param BookingPartnerTurnover $bookingPartnerTurnover
  932.      * @return Partner
  933.      */
  934.     public function addBookingPartnerTurnover(BookingPartnerTurnover $bookingPartnerTurnover): self
  935.     {
  936.         if (!$this->bookingPartnerTurnovers->contains($bookingPartnerTurnover)) {
  937.             $this->bookingPartnerTurnovers[] = $bookingPartnerTurnover;
  938.             $bookingPartnerTurnover->setPartner($this);
  939.         }
  940.         return $this;
  941.     }
  942.     /**
  943.      * @param BookingPartnerTurnover $bookingPartnerTurnover
  944.      * @return Partner
  945.      */
  946.     public function removeBookingPartnerTurnover(BookingPartnerTurnover $bookingPartnerTurnover): self
  947.     {
  948.         if ($this->bookingPartnerTurnovers->removeElement($bookingPartnerTurnover)) {
  949.             if ($bookingPartnerTurnover->getPartner() === $this) {
  950.                 $bookingPartnerTurnover->setPartner(null);
  951.             }
  952.         }
  953.         return $this;
  954.     }
  955.     /**
  956.      * @return float|null
  957.      */
  958.     public function getCurrentYearTurnover(): ?float
  959.     {
  960.         return $this->currentYearTurnover;
  961.     }
  962.     /**
  963.      * @param float|null $currentYearTurnover
  964.      * @return Partner
  965.      */
  966.     public function setCurrentYearTurnover(?float $currentYearTurnover): Partner
  967.     {
  968.         $this->currentYearTurnover $currentYearTurnover;
  969.         return $this;
  970.     }
  971.     /**
  972.      * @return float|null
  973.      */
  974.     public function getPreviousYearTurnover(): ?float
  975.     {
  976.         return $this->previousYearTurnover;
  977.     }
  978.     /**
  979.      * @param float|null $previousYearTurnover
  980.      * @return Partner
  981.      */
  982.     public function setPreviousYearTurnover(?float $previousYearTurnover): Partner
  983.     {
  984.         $this->previousYearTurnover $previousYearTurnover;
  985.         return $this;
  986.     }
  987.     /**
  988.      * @return PartnerTemplate[]|Collection
  989.      */
  990.     public function getPartnerTemplates()
  991.     {
  992.         return $this->partnerTemplates;
  993.     }
  994.     /**
  995.      * @param PartnerTemplate[]|Collection $partnerTemplates
  996.      * @return Partner
  997.      */
  998.     public function setPartnerTemplates($partnerTemplates): self
  999.     {
  1000.         $this->partnerTemplates $partnerTemplates;
  1001.         return $this;
  1002.     }
  1003.     /**
  1004.      * @param PartnerTemplate $partnerTemplate
  1005.      * @return Partner
  1006.      */
  1007.     public function addPartnerTemplate(PartnerTemplate $partnerTemplate): self
  1008.     {
  1009.         if (!$this->partnerTemplates->contains($partnerTemplate)) {
  1010.             $this->partnerTemplates[] = $partnerTemplate;
  1011.             $partnerTemplate->setPartner($this);
  1012.         }
  1013.         return $this;
  1014.     }
  1015.     /**
  1016.      * @param PartnerTemplate $partnerTemplate
  1017.      * @return Partner
  1018.      */
  1019.     public function removePartnerTemplate(PartnerTemplate $partnerTemplate): self
  1020.     {
  1021.         if ($this->partnerTemplates->removeElement($partnerTemplate)) {
  1022.             if ($partnerTemplate->getPartner() === $this) {
  1023.                 $partnerTemplate->setPartner(null);
  1024.             }
  1025.         }
  1026.         return $this;
  1027.     }
  1028. }