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

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