src/Flexy/ShopBundle/Entity/Customer/Customer.php line 36

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Customer;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Entity\User;
  5. use App\Flexy\ShopBundle\Entity\Accounting\Invoice;
  6. use App\Flexy\ShopBundle\Entity\Order\Order;
  7. use App\Flexy\ShopBundle\Entity\Payment\BankBookItem;
  8. use App\Flexy\ShopBundle\Entity\Product\Comment;
  9. use App\Flexy\ShopBundle\Entity\Product\ProductSubscription;
  10. use App\Flexy\ShopBundle\Entity\Promotion\Coupon;
  11. use App\Flexy\ShopBundle\Entity\Shipping\CashOnDelivery;
  12. use App\Flexy\ShopBundle\Entity\Shipping\CityRegion;
  13. use App\Flexy\ShopBundle\Entity\Shipping\Shipment;
  14. use App\Flexy\ShopBundle\Entity\Store\Store;
  15. use App\Flexy\ShopBundle\Entity\Vendor\Vendor;
  16. use App\Flexy\ShopBundle\Repository\Customer\CustomerRepository;
  17. use Doctrine\Common\Collections\ArrayCollection;
  18. use Doctrine\Common\Collections\Collection;
  19. use Doctrine\ORM\Mapping as ORM;
  20. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  21. use Symfony\Component\Serializer\Annotation\Groups;
  22. use Symfony\Component\Validator\Constraints as Assert;
  23. use Gedmo\Mapping\Annotation as Gedmo;
  24. #[ApiResource(
  25.     denormalizationContext: ['groups' => ['write']],
  26. )]
  27. #[ORM\Entity(repositoryClassCustomerRepository::class)]
  28. #[UniqueEntity(
  29.     fields: ['email'],
  30.     message'Ce compte déja existe.',
  31. )]
  32. #[Gedmo\SoftDeleteable(fieldName'deletedAt'timeAwarefalsehardDeletetrue)]
  33. class Customer implements \Stringable
  34. {
  35.     #[ORM\Id]
  36.     #[ORM\GeneratedValue]
  37.     #[ORM\Column(type'integer')]
  38.     private $id;
  39.     #[ORM\Column(type'text'nullabletrue)]
  40.     private ?string $description null;
  41.     #[Groups("write")]
  42.     #[ORM\Column(type'string'length255nullablefalseuniquetrue)]
  43.     #[Assert\Email]
  44.     #[Assert\NotNull]
  45.     #[Assert\NotBlank]
  46.     private ?string $email null;
  47.     #[ORM\Column(type'datetime'nullabletrue)]
  48.     private ?\DateTime $createdAt null;
  49.     #[Groups("write")]
  50.     #[ORM\Column(type'string'length255)]
  51.     private ?string $firstName null;
  52.     #[Groups("write")]
  53.     #[ORM\Column(type'string'length255)]
  54.     private ?string $lastName null;
  55.     #[ORM\Column(type'string'length255nullabletrue)]
  56.     private ?string $address null;
  57.         #[ORM\Column(type'string'length255nullabletrue)]
  58.     private $city;
  59.     #[Groups("write")]
  60.     #[ORM\Column(type'string'length255)]
  61.     #[Assert\Regex(pattern'/^[0-9]*$/', match: truemessage'Veuillez entrer une numéro de téléphone valide(en chiffres)')]
  62.     #[Assert\Length(min10)]
  63.     private ?string $phone null;
  64.     #[Groups("write")]
  65.     #[ORM\Column(type'string'length255nullabletrue)]
  66.     private ?string $companyName null;
  67.     #[Groups("write")]
  68.     #[ORM\Column(type'string'length255nullabletrue)]
  69.     private ?string $addressIndication null;
  70.     #[ORM\Column(type'string'length255nullabletrue)]
  71.     private ?string $country null;
  72.     #[ORM\Column(type'string'length255nullabletrue)]
  73.     private ?string $postCode null;
  74.     #[ORM\OneToMany(targetEntityOrder::class, mappedBy'customer'orphanRemovaltruecascade: ['persist''remove'])]
  75.     private \Doctrine\Common\Collections\Collection $orders;
  76.     #[Groups("write")]
  77.     #[ORM\ManyToOne(targetEntityCustomerGroup::class, inversedBy'customers'cascade: ['persist'])]
  78.     private ?\App\Flexy\ShopBundle\Entity\Customer\CustomerGroup $customerGroup null;
  79.     #[Groups("write")]
  80.     #[ORM\OneToOne(targetEntityUser::class, orphanRemovaltruecascade: ['persist''remove'])]
  81.     private ?\App\Entity\User $user null;
  82.     #[ORM\OneToMany(targetEntityComment::class, mappedBy'customer')]
  83.     private \Doctrine\Common\Collections\Collection|array $comments;
  84.     #[Groups("write")]
  85.     #[ORM\Column(type'string'length255nullabletrue)]
  86.     private ?string $gender null;
  87.     #[Groups("write")]
  88.     #[ORM\Column(type'date'nullabletrue)]
  89.     private ?\DateTimeInterface $dateOfBirth null;
  90.     #[ORM\OneToMany(targetEntityCustomerAddress::class, mappedBy'customer'cascade: ['persist''remove'])]
  91.     private \Doctrine\Common\Collections\Collection|array $customerAddresses;
  92.     #[ORM\OneToMany(targetEntityCustomerWalletPoint::class, mappedBy'customer'orphanRemovaltruecascade: ['persist''remove'])]
  93.     private \Doctrine\Common\Collections\Collection|array $customerWalletPoints;
  94.     #[ORM\ManyToOne(targetEntityVendor::class, inversedBy'customers')]
  95.     private ?\App\Flexy\ShopBundle\Entity\Vendor\Vendor $vendor null;
  96.     #[ORM\ManyToOne(targetEntityCityRegion::class)]
  97.     private $cityRegion;
  98.     #[ORM\OneToMany(targetEntityPackEngagement::class, mappedBy'customer'cascade: ['remove'], orphanRemovaltrue)]
  99.     private \Doctrine\Common\Collections\Collection|array $packEngagements;
  100.     #[Groups("write")]
  101.     #[ORM\Column(type'string'length255nullabletrue)]
  102.     private ?string $sponsorshipCode null;
  103.     #[Groups("write")]
  104.     #[ORM\Column(type'string'length255nullabletrue)]
  105.     private ?string $image null;
  106.     #[ORM\ManyToMany(targetEntityCoupon::class, mappedBy'allowedCustomers')]
  107.     private \Doctrine\Common\Collections\Collection|array $affectedCoupons;
  108.     #[ORM\OneToMany(targetEntityCoupon::class, mappedBy'onlyThisCustomer')]
  109.     private \Doctrine\Common\Collections\Collection|array $affectedCouponsOnlyForMe;
  110.         #[Groups("write")]
  111.     #[ORM\Column(type'boolean'nullabletrue)]
  112.     private $canReceiveMails;
  113.     #[Groups("write")]
  114.     #[ORM\Column(type'boolean'nullabletrue)]
  115.     private $canReceiveSms;
  116.     #[ORM\Column(type'string'length255nullabletrue)]
  117.     private $blindPassword;
  118.     #[ORM\Column(nullabletrue)]
  119.     private ?\DateTimeImmutable $deletedAt null;
  120.     #[ORM\OneToMany(mappedBy'senderCustomer'targetEntityShipment::class)]
  121.     private Collection $sentShipments;
  122.     #[ORM\OneToMany(mappedBy'recipientCustomer'targetEntityShipment::class)]
  123.     private Collection $receivedShipments;
  124.     #[ORM\OneToMany(mappedBy'customer'targetEntityBankBookItem::class)]
  125.     private Collection $bankBookItems;
  126.     #[ORM\OneToMany(mappedBy'customer'targetEntityCashOnDelivery::class)]
  127.     private Collection $cashOnDeliveries;
  128.     #[ORM\OneToMany(mappedBy'customer'targetEntityProductSubscription::class)]
  129.     private Collection $productSubscriptions;
  130.     #[ORM\ManyToOne(inversedBy'customers')]
  131.     private ?Store $store null;
  132.     #[ORM\OneToMany(mappedBy'customer'targetEntityInvoice::class)]
  133.     private Collection $invoices;
  134.     #[ORM\Column(length255nullabletrue)]
  135.     #[Groups("write")]
  136.     private ?string $collectAddress null;
  137.     #[ORM\Column(length255nullabletrue)]
  138.     #[Groups("write")]
  139.     private ?string $shippingAddress null;
  140.     #[ORM\Column(length255nullabletrue)]
  141.     #[Groups("write")]
  142.     private ?string $collectLat null;
  143.     #[ORM\Column(length255nullabletrue)]
  144.     #[Groups("write")]
  145.     private ?string $collectLng null;
  146.     #[ORM\Column(length255nullabletrue)]
  147.     #[Groups("write")]
  148.     private ?string $shippingLng null;
  149.     #[ORM\OneToMany(mappedBy'customer'targetEntityComplaint::class)]
  150.     private Collection $complaints;
  151.     #[ORM\Column(length255nullabletrue)]
  152.     private ?string $code null;
  153.     #[ORM\Column(length255nullabletrue)]
  154.     private ?string $reference null;
  155.     #[ORM\Column(length255nullabletrue)]
  156.     private ?string $identityNumber null;
  157.     #[ORM\OneToMany(mappedBy'customer'targetEntityVisit::class)]
  158.     private Collection $visits;
  159.     #[ORM\Column(nullabletrue)]
  160.     private ?bool $is_actif null;
  161.    
  162.     public function __construct()
  163.     {
  164.         $this->sentShipments = new ArrayCollection();
  165.         $this->receivedShipments = new ArrayCollection();
  166.         $this->bankBookItems = new ArrayCollection();
  167.         $this->cashOnDeliveries = new ArrayCollection();
  168.         $this->productSubscriptions = new ArrayCollection();
  169.         $this->invoices = new ArrayCollection();
  170.         $this->customerWalletPoints = new ArrayCollection();
  171.         $this->createdAt = new \DateTime();
  172.         $this->complaints = new ArrayCollection();
  173.         $this->orders = new ArrayCollection();
  174.         $this->visits = new ArrayCollection();
  175.     }
  176.     public function __toString(): string
  177.     {
  178.         return $this->firstName." ".$this->lastName;
  179.     }
  180.     public function getId(): ?int
  181.     {
  182.         return $this->id;
  183.     }
  184.     public function getDescription(): ?string
  185.     {
  186.         return $this->description;
  187.     }
  188.     public function setDescription(?string $description): self
  189.     {
  190.         $this->description $description;
  191.         return $this;
  192.     }
  193.     public function getEmail(): ?string
  194.     {
  195.         return $this->email;
  196.     }
  197.     public function setEmail(?string $email): self
  198.     {
  199.         $this->email $email;
  200.         return $this;
  201.     }
  202.     public function getCreatedAt(): ?\DateTime
  203.     {
  204.         return $this->createdAt;
  205.     }
  206.     public function setCreatedAt(?\DateTime $createdAt): self
  207.     {
  208.         $this->createdAt $createdAt;
  209.         return $this;
  210.     }
  211.     public function getFirstName(): ?string
  212.     {
  213.         return $this->firstName;
  214.     }
  215.     public function setFirstName(string $firstName): self
  216.     {
  217.         $this->firstName $firstName;
  218.         return $this;
  219.     }
  220.     public function getLastName(): ?string
  221.     {
  222.         return $this->lastName;
  223.     }
  224.     public function setLastName(string $lastName): self
  225.     {
  226.         $this->lastName $lastName;
  227.         return $this;
  228.     }
  229.     public function getAddress(): ?string
  230.     {
  231.         return $this->address;
  232.     }
  233.     public function setAddress(?string $address): self
  234.     {
  235.         $this->address $address;
  236.         return $this;
  237.     }
  238.     public function getPhone(): ?string
  239.     {
  240.         return $this->phone;
  241.     }
  242.     public function setPhone(string $phone): self
  243.     {
  244.         $this->phone $phone;
  245.         return $this;
  246.     }
  247.     public function getCompanyName(): ?string
  248.     {
  249.         return $this->companyName;
  250.     }
  251.     public function setCompanyName(?string $companyName): self
  252.     {
  253.         $this->companyName $companyName;
  254.         return $this;
  255.     }
  256.     public function getAddressIndication(): ?string
  257.     {
  258.         return $this->addressIndication;
  259.     }
  260.     public function setAddressIndication(?string $addressIndication): self
  261.     {
  262.         $this->addressIndication $addressIndication;
  263.         return $this;
  264.     }
  265.     public function getCountry(): ?string
  266.     {
  267.         return $this->country;
  268.     }
  269.     public function setCountry(?string $country): self
  270.     {
  271.         $this->country $country;
  272.         return $this;
  273.     }
  274.     public function getPostCode(): ?string
  275.     {
  276.         return $this->postCode;
  277.     }
  278.     public function setPostCode(string $postCode): self
  279.     {
  280.         $this->postCode $postCode;
  281.         return $this;
  282.     }
  283.     /**
  284.      * @return Collection|Order[]
  285.      */
  286.     public function getOrders(): Collection
  287.     {
  288.         return $this->orders;
  289.     }
  290.     public function addOrder(Order $order): self
  291.     {
  292.         if (!$this->orders->contains($order)) {
  293.             $this->orders[] = $order;
  294.             $order->setCustomer($this);
  295.         }
  296.         return $this;
  297.     }
  298.     public function removeOrder(Order $order): self
  299.     {
  300.         if ($this->orders->removeElement($order)) {
  301.             // set the owning side to null (unless already changed)
  302.             if ($order->getCustomer() === $this) {
  303.                 $order->setCustomer(null);
  304.             }
  305.         }
  306.         return $this;
  307.     }
  308.     public function getCustomerGroup(): ?CustomerGroup
  309.     {
  310.         return $this->customerGroup;
  311.     }
  312.     public function setCustomerGroup(?CustomerGroup $customerGroup): self
  313.     {
  314.         $this->customerGroup $customerGroup;
  315.         return $this;
  316.     }
  317.     public function getUser(): ?User
  318.     {
  319.         return $this->user;
  320.     }
  321.     public function setUser(?User $user): self
  322.     {
  323.         $this->user $user;
  324.         return $this;
  325.     }
  326.     /**
  327.      * @return Collection|Comment[]
  328.      */
  329.     public function getComments(): Collection
  330.     {
  331.         return $this->comments;
  332.     }
  333.     public function addComment(Comment $comment): self
  334.     {
  335.         if (!$this->comments->contains($comment)) {
  336.             $this->comments[] = $comment;
  337.             $comment->setCustomer($this);
  338.         }
  339.         return $this;
  340.     }
  341.     public function removeComment(Comment $comment): self
  342.     {
  343.         if ($this->comments->removeElement($comment)) {
  344.             // set the owning side to null (unless already changed)
  345.             if ($comment->getCustomer() === $this) {
  346.                 $comment->setCustomer(null);
  347.             }
  348.         }
  349.         return $this;
  350.     }
  351.     public function getGender(): ?string
  352.     {
  353.         return $this->gender;
  354.     }
  355.     public function setGender(?string $gender): self
  356.     {
  357.         $this->gender $gender;
  358.         return $this;
  359.     }
  360.     public function getDateOfBirth(): ?\DateTimeInterface
  361.     {
  362.         return $this->dateOfBirth;
  363.     }
  364.     public function setDateOfBirth(?\DateTimeInterface $dateOfBirth): self
  365.     {
  366.         $this->dateOfBirth $dateOfBirth;
  367.         return $this;
  368.     }
  369.     /**
  370.      * @return Collection<int, CustomerAddress>
  371.      */
  372.     public function getCustomerAddresses(): Collection
  373.     {
  374.         return $this->customerAddresses;
  375.     }
  376.     public function addCustomerAddress(CustomerAddress $customerAddress): self
  377.     {
  378.         if (!$this->customerAddresses->contains($customerAddress)) {
  379.             $this->customerAddresses[] = $customerAddress;
  380.             $customerAddress->setCustomer($this);
  381.         }
  382.         return $this;
  383.     }
  384.     public function removeCustomerAddress(CustomerAddress $customerAddress): self
  385.     {
  386.         if ($this->customerAddresses->removeElement($customerAddress)) {
  387.             // set the owning side to null (unless already changed)
  388.             if ($customerAddress->getCustomer() === $this) {
  389.                 $customerAddress->setCustomer(null);
  390.             }
  391.         }
  392.         return $this;
  393.     }
  394.     /**
  395.      * @return Collection<int, CustomerWalletPoint>
  396.      */
  397.     public function getCustomerWalletPoints(): Collection
  398.     {
  399.         return $this->customerWalletPoints;
  400.     }
  401.     public function addCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  402.     {
  403.         if (!$this->customerWalletPoints->contains($customerWalletPoint)) {
  404.             $this->customerWalletPoints[] = $customerWalletPoint;
  405.             $customerWalletPoint->setCustomer($this);
  406.         }
  407.         return $this;
  408.     }
  409.     public function removeCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  410.     {
  411.         if ($this->customerWalletPoints->removeElement($customerWalletPoint)) {
  412.             // set the owning side to null (unless already changed)
  413.             if ($customerWalletPoint->getCustomer() === $this) {
  414.                 $customerWalletPoint->setCustomer(null);
  415.             }
  416.         }
  417.         return $this;
  418.     }
  419.     public function getCredit(){
  420.         $credit 0;
  421.         foreach($this->getCustomerWalletPoints() as $singleWalletPoint){
  422.             $credit $credit $singleWalletPoint->getPoints();
  423.         }
  424.         return $credit;
  425.     }
  426.     public function getVendor(): ?Vendor
  427.     {
  428.         return $this->vendor;
  429.     }
  430.     public function setVendor(?Vendor $vendor): self
  431.     {
  432.         $this->vendor $vendor;
  433.         return $this;
  434.     }
  435.     /**
  436.      * @return Collection<int, PackEngagement>
  437.      */
  438.     public function getPackEngagements(): Collection
  439.     {
  440.         return $this->packEngagements;
  441.     }
  442.     public function addPackEngagement(PackEngagement $packEngagement): self
  443.     {
  444.         if (!$this->packEngagements->contains($packEngagement)) {
  445.             $this->packEngagements[] = $packEngagement;
  446.             $packEngagement->setCustomer($this);
  447.         }
  448.         return $this;
  449.     }
  450.     public function removePackEngagement(PackEngagement $packEngagement): self
  451.     {
  452.         if ($this->packEngagements->removeElement($packEngagement)) {
  453.             // set the owning side to null (unless already changed)
  454.             if ($packEngagement->getCustomer() === $this) {
  455.                 $packEngagement->setCustomer(null);
  456.             }
  457.         }
  458.         return $this;
  459.     }
  460.     public function getSponsorshipCode(): ?string
  461.     {
  462.         return $this->sponsorshipCode;
  463.     }
  464.     public function setSponsorshipCode(?string $sponsorshipCode): self
  465.     {
  466.         $this->sponsorshipCode $sponsorshipCode;
  467.         return $this;
  468.     }
  469.     public function getMySponsorshipCode(){
  470.         return "PRN0000".$this->getId();
  471.     }
  472.     public function getImage(): ?string
  473.     {
  474.         return $this->image;
  475.     }
  476.     public function setImage(?string $image): self
  477.     {
  478.         $this->image $image;
  479.         return $this;
  480.     }
  481.     /**
  482.      * @return Collection<int, Coupon>
  483.      */
  484.     public function getAffectedCoupons(): Collection
  485.     {
  486.         return $this->affectedCoupons;
  487.     }
  488.     public function addAffectedCoupon(Coupon $affectedCoupon): self
  489.     {
  490.         if (!$this->affectedCoupons->contains($affectedCoupon)) {
  491.             $this->affectedCoupons[] = $affectedCoupon;
  492.             $affectedCoupon->addAllowedCustomer($this);
  493.         }
  494.         return $this;
  495.     }
  496.     public function removeAffectedCoupon(Coupon $affectedCoupon): self
  497.     {
  498.         if ($this->affectedCoupons->removeElement($affectedCoupon)) {
  499.             $affectedCoupon->removeAllowedCustomer($this);
  500.         }
  501.         return $this;
  502.     }
  503.     /**
  504.      * @return Collection<int, Coupon>
  505.      */
  506.     public function getAffectedCouponsOnlyForMe(): Collection
  507.     {
  508.         return $this->affectedCouponsOnlyForMe;
  509.     }
  510.     public function addAffectedCouponsOnlyForMe(Coupon $affectedCouponsOnlyForMe): self
  511.     {
  512.         if (!$this->affectedCouponsOnlyForMe->contains($affectedCouponsOnlyForMe)) {
  513.             $this->affectedCouponsOnlyForMe[] = $affectedCouponsOnlyForMe;
  514.             $affectedCouponsOnlyForMe->setOnlyThisCustomer($this);
  515.         }
  516.         return $this;
  517.     }
  518.     public function removeAffectedCouponsOnlyForMe(Coupon $affectedCouponsOnlyForMe): self
  519.     {
  520.         if ($this->affectedCouponsOnlyForMe->removeElement($affectedCouponsOnlyForMe)) {
  521.             // set the owning side to null (unless already changed)
  522.             if ($affectedCouponsOnlyForMe->getOnlyThisCustomer() === $this) {
  523.                 $affectedCouponsOnlyForMe->setOnlyThisCustomer(null);
  524.             }
  525.         }
  526.         return $this;
  527.     }
  528.     
  529.      
  530.     /**
  531.      * Get the value of canReceiveMails
  532.      */ 
  533.     public function getCanReceiveMails()
  534.     {
  535.         return $this->canReceiveMails;
  536.     }
  537.     /**
  538.      * Set the value of canReceiveMails
  539.      *
  540.      * @return  self
  541.      */ 
  542.     public function setCanReceiveMails($canReceiveMails)
  543.     {
  544.         $this->canReceiveMails $canReceiveMails;
  545.         return $this;
  546.     }
  547.     /**
  548.      * Get the value of canReceiveSms
  549.      */ 
  550.     public function getCanReceiveSms()
  551.     {
  552.         return $this->canReceiveSms;
  553.     }
  554.     /**
  555.      * Set the value of canReceiveSms
  556.      *
  557.      * @return  self
  558.      */ 
  559.     public function setCanReceiveSms($canReceiveSms)
  560.     {
  561.         $this->canReceiveSms $canReceiveSms;
  562.         return $this;
  563.     }
  564.     /**
  565.      * Get the value of blindPassword
  566.      */ 
  567.     public function getBlindPassword()
  568.     {
  569.         return $this->blindPassword;
  570.     }
  571.     /**
  572.      * Set the value of blindPassword
  573.      *
  574.      * @return  self
  575.      */ 
  576.     public function setBlindPassword($blindPassword)
  577.     {
  578.         $this->blindPassword $blindPassword;
  579.         return $this;
  580.     }
  581.     /**
  582.      * Get the value of city
  583.      */ 
  584.     public function getCity()
  585.     {
  586.         return $this->city;
  587.     }
  588.     /**
  589.      * Set the value of city
  590.      *
  591.      * @return  self
  592.      */ 
  593.     public function setCity($city)
  594.     {
  595.         $this->city $city;
  596.         return $this;
  597.     }
  598.     /**
  599.      * Get the value of cityRegion
  600.      */ 
  601.     public function getCityRegion()
  602.     {
  603.         return $this->cityRegion;
  604.     }
  605.     /**
  606.      * Set the value of cityRegion
  607.      *
  608.      * @return  self
  609.      */ 
  610.     public function setCityRegion($cityRegion)
  611.     {
  612.         $this->cityRegion $cityRegion;
  613.         return $this;
  614.     }
  615.     public function getDeletedAt(): ?\DateTimeImmutable
  616.     {
  617.         return $this->deletedAt;
  618.     }
  619.     public function setDeletedAt(?\DateTimeImmutable $deletedAt): self
  620.     {
  621.         $this->deletedAt $deletedAt;
  622.         return $this;
  623.     }
  624.     /**
  625.      * @return Collection<int, Shipment>
  626.      */
  627.     public function getSentShipments(): Collection
  628.     {
  629.         return $this->sentShipments;
  630.     }
  631.     public function addSentShipment(Shipment $sentShipment): self
  632.     {
  633.         if (!$this->sentShipments->contains($sentShipment)) {
  634.             $this->sentShipments->add($sentShipment);
  635.             $sentShipment->setSenderCustomer($this);
  636.         }
  637.         return $this;
  638.     }
  639.     public function removeSentShipment(Shipment $sentShipment): self
  640.     {
  641.         if ($this->sentShipments->removeElement($sentShipment)) {
  642.             // set the owning side to null (unless already changed)
  643.             if ($sentShipment->getSenderCustomer() === $this) {
  644.                 $sentShipment->setSenderCustomer(null);
  645.             }
  646.         }
  647.         return $this;
  648.     }
  649.     /**
  650.      * @return Collection<int, Shipment>
  651.      */
  652.     public function getReceivedShipments(): Collection
  653.     {
  654.         return $this->receivedShipments;
  655.     }
  656.     public function addReceivedShipment(Shipment $receivedShipment): self
  657.     {
  658.         if (!$this->receivedShipments->contains($receivedShipment)) {
  659.             $this->receivedShipments->add($receivedShipment);
  660.             $receivedShipment->setRecipientCustomer($this);
  661.         }
  662.         return $this;
  663.     }
  664.     public function removeReceivedShipment(Shipment $receivedShipment): self
  665.     {
  666.         if ($this->receivedShipments->removeElement($receivedShipment)) {
  667.             // set the owning side to null (unless already changed)
  668.             if ($receivedShipment->getRecipientCustomer() === $this) {
  669.                 $receivedShipment->setRecipientCustomer(null);
  670.             }
  671.         }
  672.         return $this;
  673.     }
  674.     /**
  675.      * @return Collection<int, BankBookItem>
  676.      */
  677.     public function getBankBookItems(): Collection
  678.     {
  679.         return $this->bankBookItems;
  680.     }
  681.     public function addBankBookItem(BankBookItem $bankBookItem): self
  682.     {
  683.         if (!$this->bankBookItems->contains($bankBookItem)) {
  684.             $this->bankBookItems->add($bankBookItem);
  685.             $bankBookItem->setCustomer($this);
  686.         }
  687.         return $this;
  688.     }
  689.     public function removeBankBookItem(BankBookItem $bankBookItem): self
  690.     {
  691.         if ($this->bankBookItems->removeElement($bankBookItem)) {
  692.             // set the owning side to null (unless already changed)
  693.             if ($bankBookItem->getCustomer() === $this) {
  694.                 $bankBookItem->setCustomer(null);
  695.             }
  696.         }
  697.         return $this;
  698.     }
  699.     /**
  700.      * @return Collection<int, CashOnDelivery>
  701.      */
  702.     public function getCashOnDeliveries(): Collection
  703.     {
  704.         return $this->cashOnDeliveries;
  705.     }
  706.     public function addCashOnDelivery(CashOnDelivery $cashOnDelivery): self
  707.     {
  708.         if (!$this->cashOnDeliveries->contains($cashOnDelivery)) {
  709.             $this->cashOnDeliveries->add($cashOnDelivery);
  710.             $cashOnDelivery->setCustomer($this);
  711.         }
  712.         return $this;
  713.     }
  714.     public function removeCashOnDelivery(CashOnDelivery $cashOnDelivery): self
  715.     {
  716.         if ($this->cashOnDeliveries->removeElement($cashOnDelivery)) {
  717.             // set the owning side to null (unless already changed)
  718.             if ($cashOnDelivery->getCustomer() === $this) {
  719.                 $cashOnDelivery->setCustomer(null);
  720.             }
  721.         }
  722.         return $this;
  723.     }
  724.     /**
  725.      * @return Collection<int, ProductSubscription>
  726.      */
  727.     public function getProductSubscriptions(): Collection
  728.     {
  729.         return $this->productSubscriptions;
  730.     }
  731.     public function addProductSubscription(ProductSubscription $productSubscription): self
  732.     {
  733.         if (!$this->productSubscriptions->contains($productSubscription)) {
  734.             $this->productSubscriptions->add($productSubscription);
  735.             $productSubscription->setCustomer($this);
  736.         }
  737.         return $this;
  738.     }
  739.     public function removeProductSubscription(ProductSubscription $productSubscription): self
  740.     {
  741.         if ($this->productSubscriptions->removeElement($productSubscription)) {
  742.             // set the owning side to null (unless already changed)
  743.             if ($productSubscription->getCustomer() === $this) {
  744.                 $productSubscription->setCustomer(null);
  745.             }
  746.         }
  747.         return $this;
  748.     }
  749.     public function getStore(): ?Store
  750.     {
  751.         return $this->store;
  752.     }
  753.     public function setStore(?Store $store): self
  754.     {
  755.         $this->store $store;
  756.         return $this;
  757.     }
  758.     /**
  759.      * @return Collection<int, Invoice>
  760.      */
  761.     public function getInvoices(): Collection
  762.     {
  763.         return $this->invoices;
  764.     }
  765.     public function addInvoice(Invoice $invoice): self
  766.     {
  767.         if (!$this->invoices->contains($invoice)) {
  768.             $this->invoices->add($invoice);
  769.             $invoice->setCustomer($this);
  770.         }
  771.         return $this;
  772.     }
  773.     public function removeInvoice(Invoice $invoice): self
  774.     {
  775.         if ($this->invoices->removeElement($invoice)) {
  776.             // set the owning side to null (unless already changed)
  777.             if ($invoice->getCustomer() === $this) {
  778.                 $invoice->setCustomer(null);
  779.             }
  780.         }
  781.         return $this;
  782.     }
  783.     public function getCollectAddress(): ?string
  784.     {
  785.         return $this->collectAddress;
  786.     }
  787.     public function setCollectAddress(?string $collectAddress): self
  788.     {
  789.         $this->collectAddress $collectAddress;
  790.         return $this;
  791.     }
  792.     public function getShippingAddress(): ?string
  793.     {
  794.         return $this->shippingAddress;
  795.     }
  796.     public function setShippingAddress(?string $shippingAddress): self
  797.     {
  798.         $this->shippingAddress $shippingAddress;
  799.         return $this;
  800.     }
  801.     public function getCollectLat(): ?string
  802.     {
  803.         return $this->collectLat;
  804.     }
  805.     public function setCollectLat(?string $collectLat): self
  806.     {
  807.         $this->collectLat $collectLat;
  808.         return $this;
  809.     }
  810.     public function getCollectLng(): ?string
  811.     {
  812.         return $this->collectLng;
  813.     }
  814.     public function setCollectLng(string $collectLng): self
  815.     {
  816.         $this->collectLng $collectLng;
  817.         return $this;
  818.     }
  819.     public function getShippingLng(): ?string
  820.     {
  821.         return $this->shippingLng;
  822.     }
  823.     public function setShippingLng(?string $shippingLng): self
  824.     {
  825.         $this->shippingLng $shippingLng;
  826.         return $this;
  827.     }
  828.     /**
  829.      * @return Collection<int, Complaint>
  830.      */
  831.     public function getComplaints(): Collection
  832.     {
  833.         return $this->complaints;
  834.     }
  835.     public function addComplaint(Complaint $complaint): self
  836.     {
  837.         if (!$this->complaints->contains($complaint)) {
  838.             $this->complaints->add($complaint);
  839.             $complaint->setCustomer($this);
  840.         }
  841.         return $this;
  842.     }
  843.     public function removeComplaint(Complaint $complaint): self
  844.     {
  845.         if ($this->complaints->removeElement($complaint)) {
  846.             // set the owning side to null (unless already changed)
  847.             if ($complaint->getCustomer() === $this) {
  848.                 $complaint->setCustomer(null);
  849.             }
  850.         }
  851.         return $this;
  852.     }
  853.     public function getCode(): ?string
  854.     {
  855.         return $this->code;
  856.     }
  857.     public function setCode(?string $code): self
  858.     {
  859.         $this->code $code;
  860.         return $this;
  861.     }
  862.     public function getReference(): ?string
  863.     {
  864.         return $this->reference;
  865.     }
  866.     public function setReference(?string $reference): self
  867.     {
  868.         $this->reference $reference;
  869.         return $this;
  870.     }
  871.     public function getIdentityNumber(): ?string
  872.     {
  873.         return $this->identityNumber;
  874.     }
  875.     public function setIdentityNumber(?string $identityNumber): self
  876.     {
  877.         $this->identityNumber $identityNumber;
  878.         return $this;
  879.     }
  880.     /**
  881.      * @return Collection<int, Visit>
  882.      */
  883.     public function getVisits(): Collection
  884.     {
  885.         return $this->visits;
  886.     }
  887.     public function addVisit(Visit $visit): static
  888.     {
  889.         if (!$this->visits->contains($visit)) {
  890.             $this->visits->add($visit);
  891.             $visit->setCustomer($this);
  892.         }
  893.         return $this;
  894.     }
  895.     public function removeVisit(Visit $visit): static
  896.     {
  897.         if ($this->visits->removeElement($visit)) {
  898.             // set the owning side to null (unless already changed)
  899.             if ($visit->getCustomer() === $this) {
  900.                 $visit->setCustomer(null);
  901.             }
  902.         }
  903.         return $this;
  904.     }
  905.     public function isIsActif(): ?bool
  906.     {
  907.         return $this->is_actif;
  908.     }
  909.     public function setIsActif(?bool $is_actif): static
  910.     {
  911.         $this->is_actif $is_actif;
  912.         return $this;
  913.     }
  914. }