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.     public function __construct()
  219.     {
  220.         $this->sentShipments = new ArrayCollection();
  221.         $this->receivedShipments = new ArrayCollection();
  222.         $this->bankBookItems = new ArrayCollection();
  223.         $this->cashOnDeliveries = new ArrayCollection();
  224.         $this->productSubscriptions = new ArrayCollection();
  225.         $this->invoices = new ArrayCollection();
  226.         $this->customerWalletPoints = new ArrayCollection();
  227.         $this->createdAt = new \DateTime();
  228.         $this->complaints = new ArrayCollection();
  229.         $this->ticketsCustomers = new ArrayCollection();
  230.     }
  231.     public function __toString(): string
  232.     {
  233.         return $this->firstName." ".$this->lastName;
  234.     }
  235.     public function getId(): ?int
  236.     {
  237.         return $this->id;
  238.     }
  239.     public function getDescription(): ?string
  240.     {
  241.         return $this->description;
  242.     }
  243.     public function setDescription(?string $description): self
  244.     {
  245.         $this->description $description;
  246.         return $this;
  247.     }
  248.     public function getEmail(): ?string
  249.     {
  250.         return $this->email;
  251.     }
  252.     public function setEmail(?string $email): self
  253.     {
  254.         $this->email $email;
  255.         return $this;
  256.     }
  257.     public function getCreatedAt(): ?\DateTime
  258.     {
  259.         return $this->createdAt;
  260.     }
  261.     public function setCreatedAt(?\DateTime $createdAt): self
  262.     {
  263.         $this->createdAt $createdAt;
  264.         return $this;
  265.     }
  266.     public function getFirstName(): ?string
  267.     {
  268.         return $this->firstName;
  269.     }
  270.     public function setFirstName(string $firstName): self
  271.     {
  272.         $this->firstName $firstName;
  273.         return $this;
  274.     }
  275.      public function setImageRCFile(File $path null)
  276.     {
  277.         $this->imageRCFile $path;
  278.         // VERY IMPORTANT:
  279.         // It is required that at least one field changes if you are using Doctrine,
  280.         // otherwise the event listeners won't be called and the file is lost
  281.     }
  282.     public function getImageRCFile()
  283.     {
  284.         return $this->imageRCFile;
  285.     }
  286.     public function getPathRCImage(): ?string
  287.     {
  288.         return $this->pathRCImage;
  289.     }
  290.     public function setPathRCImage(?string $pathRCImage): self
  291.     {
  292.         $this->pathRCImage $pathRCImage;
  293.         return $this;
  294.     }
  295.     public function getPathIFImage(): ?string
  296.     {
  297.         return $this->pathIFImage;
  298.     }
  299.     public function setPathIFImage(?string $pathIFImage): self
  300.     {
  301.         $this->pathIFImage $pathIFImage;
  302.         return $this;
  303.     }
  304.       
  305.     public function getPathCinRectoImage(): ?string
  306.     {
  307.         return $this->pathCinRectoImage;
  308.     }
  309.     public function setPathCinRectoImage(?string $pathCinRectoImage): self
  310.     {
  311.         $this->pathCinRectoImage $pathCinRectoImage;
  312.         return $this;
  313.     }
  314.     
  315.     public function getPathCinVersoImage(): ?string
  316.     {
  317.         return $this->pathCinVersoImage;
  318.     }
  319.     public function setPathCinVersoImage(?string $pathCinVersoImage): self
  320.     {
  321.         $this->pathCinVersoImage $pathCinVersoImage;
  322.         return $this;
  323.     }
  324.   
  325.     
  326.     public function setImageIFFile(File $path null)
  327.     {
  328.         $this->imageIFFile $path;
  329.         // VERY IMPORTANT:
  330.         // It is required that at least one field changes if you are using Doctrine,
  331.         // otherwise the event listeners won't be called and the file is lost
  332.  
  333.     }
  334.     public function getImageIFFile()
  335.     {
  336.         return $this->imageIFFile;
  337.     }
  338.     public function setImageCinRecto(File $path null)
  339.     {
  340.         $this->imageCinRecto $path;
  341.         // VERY IMPORTANT:
  342.         // It is required that at least one field changes if you are using Doctrine,
  343.         // otherwise the event listeners won't be called and the file is lost
  344.  
  345.     }
  346.     public function getImageCinRecto()
  347.     {
  348.         return $this->imageCinRecto;
  349.     }
  350.     public function setImageCinVerso(File $path null)
  351.     {
  352.         $this->imageCinVerso $path;
  353.         // VERY IMPORTANT:
  354.         // It is required that at least one field changes if you are using Doctrine,
  355.         // otherwise the event listeners won't be called and the file is lost
  356.  
  357.     }
  358.     public function getImageCinVerso()
  359.     {
  360.         return $this->imageCinVerso;
  361.     }
  362.     public function getLastName(): ?string
  363.     {
  364.         return $this->lastName;
  365.     }
  366.     public function setLastName(string $lastName): self
  367.     {
  368.         $this->lastName $lastName;
  369.         return $this;
  370.     }
  371.     public function getAddress(): ?string
  372.     {
  373.         return $this->address;
  374.     }
  375.     public function setAddress(?string $address): self
  376.     {
  377.         $this->address $address;
  378.         return $this;
  379.     }
  380.     public function getPhone(): ?string
  381.     {
  382.         return $this->phone;
  383.     }
  384.     public function setPhone(string $phone): self
  385.     {
  386.         $this->phone $phone;
  387.         return $this;
  388.     }
  389.     public function getCompanyName(): ?string
  390.     {
  391.         return $this->companyName;
  392.     }
  393.     public function setCompanyName(?string $companyName): self
  394.     {
  395.         $this->companyName $companyName;
  396.         return $this;
  397.     }
  398.     public function getAddressIndication(): ?string
  399.     {
  400.         return $this->addressIndication;
  401.     }
  402.     public function setAddressIndication(?string $addressIndication): self
  403.     {
  404.         $this->addressIndication $addressIndication;
  405.         return $this;
  406.     }
  407.     public function getCountry(): ?string
  408.     {
  409.         return $this->country;
  410.     }
  411.     public function setCountry(?string $country): self
  412.     {
  413.         $this->country $country;
  414.         return $this;
  415.     }
  416.     public function getPostCode(): ?string
  417.     {
  418.         return $this->postCode;
  419.     }
  420.     public function setPostCode(string $postCode): self
  421.     {
  422.         $this->postCode $postCode;
  423.         return $this;
  424.     }
  425.     /**
  426.      * @return Collection|Order[]
  427.      */
  428.     public function getOrders(): Collection
  429.     {
  430.         return $this->orders;
  431.     }
  432.     public function addOrder(Order $order): self
  433.     {
  434.         if (!$this->orders->contains($order)) {
  435.             $this->orders[] = $order;
  436.             $order->setCustomer($this);
  437.         }
  438.         return $this;
  439.     }
  440.     public function removeOrder(Order $order): self
  441.     {
  442.         if ($this->orders->removeElement($order)) {
  443.             // set the owning side to null (unless already changed)
  444.             if ($order->getCustomer() === $this) {
  445.                 $order->setCustomer(null);
  446.             }
  447.         }
  448.         return $this;
  449.     }
  450.     public function getCustomerGroup(): ?CustomerGroup
  451.     {
  452.         return $this->customerGroup;
  453.     }
  454.     public function setCustomerGroup(?CustomerGroup $customerGroup): self
  455.     {
  456.         $this->customerGroup $customerGroup;
  457.         return $this;
  458.     }
  459.     public function getUser(): ?User
  460.     {
  461.         return $this->user;
  462.     }
  463.     public function setUser(?User $user): self
  464.     {
  465.         $this->user $user;
  466.         return $this;
  467.     }
  468.     /**
  469.      * @return Collection|Comment[]
  470.      */
  471.     public function getComments(): Collection
  472.     {
  473.         return $this->comments;
  474.     }
  475.     public function addComment(Comment $comment): self
  476.     {
  477.         if (!$this->comments->contains($comment)) {
  478.             $this->comments[] = $comment;
  479.             $comment->setCustomer($this);
  480.         }
  481.         return $this;
  482.     }
  483.     public function removeComment(Comment $comment): self
  484.     {
  485.         if ($this->comments->removeElement($comment)) {
  486.             // set the owning side to null (unless already changed)
  487.             if ($comment->getCustomer() === $this) {
  488.                 $comment->setCustomer(null);
  489.             }
  490.         }
  491.         return $this;
  492.     }
  493.     public function getGender(): ?string
  494.     {
  495.         return $this->gender;
  496.     }
  497.     public function setGender(?string $gender): self
  498.     {
  499.         $this->gender $gender;
  500.         return $this;
  501.     }
  502.     public function getDateOfBirth(): ?\DateTimeInterface
  503.     {
  504.         return $this->dateOfBirth;
  505.     }
  506.     public function setDateOfBirth(?\DateTimeInterface $dateOfBirth): self
  507.     {
  508.         $this->dateOfBirth $dateOfBirth;
  509.         return $this;
  510.     }
  511.     /**
  512.      * @return Collection<int, CustomerAddress>
  513.      */
  514.     public function getCustomerAddresses(): Collection
  515.     {
  516.         return $this->customerAddresses;
  517.     }
  518.     public function addCustomerAddress(CustomerAddress $customerAddress): self
  519.     {
  520.         if (!$this->customerAddresses->contains($customerAddress)) {
  521.             $this->customerAddresses[] = $customerAddress;
  522.             $customerAddress->setCustomer($this);
  523.         }
  524.         return $this;
  525.     }
  526.     public function removeCustomerAddress(CustomerAddress $customerAddress): self
  527.     {
  528.         if ($this->customerAddresses->removeElement($customerAddress)) {
  529.             // set the owning side to null (unless already changed)
  530.             if ($customerAddress->getCustomer() === $this) {
  531.                 $customerAddress->setCustomer(null);
  532.             }
  533.         }
  534.         return $this;
  535.     }
  536.     /**
  537.      * @return Collection<int, CustomerWalletPoint>
  538.      */
  539.     public function getCustomerWalletPoints(): Collection
  540.     {
  541.         return $this->customerWalletPoints;
  542.     }
  543.     public function addCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  544.     {
  545.         if (!$this->customerWalletPoints->contains($customerWalletPoint)) {
  546.             $this->customerWalletPoints[] = $customerWalletPoint;
  547.             $customerWalletPoint->setCustomer($this);
  548.         }
  549.         return $this;
  550.     }
  551.     public function removeCustomerWalletPoint(CustomerWalletPoint $customerWalletPoint): self
  552.     {
  553.         if ($this->customerWalletPoints->removeElement($customerWalletPoint)) {
  554.             // set the owning side to null (unless already changed)
  555.             if ($customerWalletPoint->getCustomer() === $this) {
  556.                 $customerWalletPoint->setCustomer(null);
  557.             }
  558.         }
  559.         return $this;
  560.     }
  561.     #[Groups(["read","write"])]
  562.     public function getCredit(){
  563.         $credit 0;
  564.         foreach($this->getCustomerWalletPoints() as $singleWalletPoint){
  565.             $credit $credit $singleWalletPoint->getPoints();
  566.         }
  567.         return $credit;
  568.     }
  569.     public function getVendor(): ?Vendor
  570.     {
  571.         return $this->vendor;
  572.     }
  573.     public function setVendor(?Vendor $vendor): self
  574.     {
  575.         $this->vendor $vendor;
  576.         return $this;
  577.     }
  578.     /**
  579.      * @return Collection<int, PackEngagement>
  580.      */
  581.     public function getPackEngagements(): Collection
  582.     {
  583.         return $this->packEngagements;
  584.     }
  585.     public function addPackEngagement(PackEngagement $packEngagement): self
  586.     {
  587.         if (!$this->packEngagements->contains($packEngagement)) {
  588.             $this->packEngagements[] = $packEngagement;
  589.             $packEngagement->setCustomer($this);
  590.         }
  591.         return $this;
  592.     }
  593.     public function removePackEngagement(PackEngagement $packEngagement): self
  594.     {
  595.         if ($this->packEngagements->removeElement($packEngagement)) {
  596.             // set the owning side to null (unless already changed)
  597.             if ($packEngagement->getCustomer() === $this) {
  598.                 $packEngagement->setCustomer(null);
  599.             }
  600.         }
  601.         return $this;
  602.     }
  603.     public function getSponsorshipCode(): ?string
  604.     {
  605.         return $this->sponsorshipCode;
  606.     }
  607.     public function setSponsorshipCode(?string $sponsorshipCode): self
  608.     {
  609.         $this->sponsorshipCode $sponsorshipCode;
  610.         return $this;
  611.     }
  612.     public function getMySponsorshipCode(){
  613.         return "PRN0000".$this->getId();
  614.     }
  615.     public function getImage(): ?string
  616.     {
  617.         return $this->image;
  618.     }
  619.     public function setImage(?string $image): self
  620.     {
  621.         $this->image $image;
  622.         return $this;
  623.     }
  624.     /**
  625.      * @return Collection<int, Coupon>
  626.      */
  627.     public function getAffectedCoupons(): Collection
  628.     {
  629.         return $this->affectedCoupons;
  630.     }
  631.     public function addAffectedCoupon(Coupon $affectedCoupon): self
  632.     {
  633.         if (!$this->affectedCoupons->contains($affectedCoupon)) {
  634.             $this->affectedCoupons[] = $affectedCoupon;
  635.             $affectedCoupon->addAllowedCustomer($this);
  636.         }
  637.         return $this;
  638.     }
  639.     public function removeAffectedCoupon(Coupon $affectedCoupon): self
  640.     {
  641.         if ($this->affectedCoupons->removeElement($affectedCoupon)) {
  642.             $affectedCoupon->removeAllowedCustomer($this);
  643.         }
  644.         return $this;
  645.     }
  646.     /**
  647.      * @return Collection<int, Coupon>
  648.      */
  649.     public function getAffectedCouponsOnlyForMe(): Collection
  650.     {
  651.         return $this->affectedCouponsOnlyForMe;
  652.     }
  653.     public function addAffectedCouponsOnlyForMe(Coupon $affectedCouponsOnlyForMe): self
  654.     {
  655.         if (!$this->affectedCouponsOnlyForMe->contains($affectedCouponsOnlyForMe)) {
  656.             $this->affectedCouponsOnlyForMe[] = $affectedCouponsOnlyForMe;
  657.             $affectedCouponsOnlyForMe->setOnlyThisCustomer($this);
  658.         }
  659.         return $this;
  660.     }
  661.     public function removeAffectedCouponsOnlyForMe(Coupon $affectedCouponsOnlyForMe): self
  662.     {
  663.         if ($this->affectedCouponsOnlyForMe->removeElement($affectedCouponsOnlyForMe)) {
  664.             // set the owning side to null (unless already changed)
  665.             if ($affectedCouponsOnlyForMe->getOnlyThisCustomer() === $this) {
  666.                 $affectedCouponsOnlyForMe->setOnlyThisCustomer(null);
  667.             }
  668.         }
  669.         return $this;
  670.     }
  671.     
  672.      
  673.     /**
  674.      * Get the value of canReceiveMails
  675.      */ 
  676.     public function getCanReceiveMails()
  677.     {
  678.         return $this->canReceiveMails;
  679.     }
  680.     /**
  681.      * Set the value of canReceiveMails
  682.      *
  683.      * @return  self
  684.      */ 
  685.     public function setCanReceiveMails($canReceiveMails)
  686.     {
  687.         $this->canReceiveMails $canReceiveMails;
  688.         return $this;
  689.     }
  690.     /**
  691.      * Get the value of canReceiveSms
  692.      */ 
  693.     public function getCanReceiveSms()
  694.     {
  695.         return $this->canReceiveSms;
  696.     }
  697.     /**
  698.      * Set the value of canReceiveSms
  699.      *
  700.      * @return  self
  701.      */ 
  702.     public function setCanReceiveSms($canReceiveSms)
  703.     {
  704.         $this->canReceiveSms $canReceiveSms;
  705.         return $this;
  706.     }
  707.     /**
  708.      * Get the value of blindPassword
  709.      */ 
  710.     public function getBlindPassword()
  711.     {
  712.         return $this->blindPassword;
  713.     }
  714.     /**
  715.      * Set the value of blindPassword
  716.      *
  717.      * @return  self
  718.      */ 
  719.     public function setBlindPassword($blindPassword)
  720.     {
  721.         $this->blindPassword $blindPassword;
  722.         return $this;
  723.     }
  724.     /**
  725.      * Get the value of city
  726.      */ 
  727.     public function getCity()
  728.     {
  729.         return $this->city;
  730.     }
  731.     /**
  732.      * Set the value of city
  733.      *
  734.      * @return  self
  735.      */ 
  736.     public function setCity($city)
  737.     {
  738.         $this->city $city;
  739.         return $this;
  740.     }
  741.     /**
  742.      * Get the value of cityRegion
  743.      */ 
  744.     public function getCityRegion()
  745.     {
  746.         return $this->cityRegion;
  747.     }
  748.     /**
  749.      * Set the value of cityRegion
  750.      *
  751.      * @return  self
  752.      */ 
  753.     public function setCityRegion($cityRegion)
  754.     {
  755.         $this->cityRegion $cityRegion;
  756.         return $this;
  757.     }
  758.     public function getDeletedAt(): ?\DateTimeImmutable
  759.     {
  760.         return $this->deletedAt;
  761.     }
  762.     public function setDeletedAt(?\DateTimeImmutable $deletedAt): self
  763.     {
  764.         $this->deletedAt $deletedAt;
  765.         return $this;
  766.     }
  767.     /**
  768.      * @return Collection<int, Shipment>
  769.      */
  770.     public function getSentShipments(): Collection
  771.     {
  772.         return $this->sentShipments;
  773.     }
  774.     public function addSentShipment(Shipment $sentShipment): self
  775.     {
  776.         if (!$this->sentShipments->contains($sentShipment)) {
  777.             $this->sentShipments->add($sentShipment);
  778.             $sentShipment->setSenderCustomer($this);
  779.         }
  780.         return $this;
  781.     }
  782.     public function removeSentShipment(Shipment $sentShipment): self
  783.     {
  784.         if ($this->sentShipments->removeElement($sentShipment)) {
  785.             // set the owning side to null (unless already changed)
  786.             if ($sentShipment->getSenderCustomer() === $this) {
  787.                 $sentShipment->setSenderCustomer(null);
  788.             }
  789.         }
  790.         return $this;
  791.     }
  792.     /**
  793.      * @return Collection<int, Shipment>
  794.      */
  795.     public function getReceivedShipments(): Collection
  796.     {
  797.         return $this->receivedShipments;
  798.     }
  799.     public function addReceivedShipment(Shipment $receivedShipment): self
  800.     {
  801.         if (!$this->receivedShipments->contains($receivedShipment)) {
  802.             $this->receivedShipments->add($receivedShipment);
  803.             $receivedShipment->setRecipientCustomer($this);
  804.         }
  805.         return $this;
  806.     }
  807.     public function removeReceivedShipment(Shipment $receivedShipment): self
  808.     {
  809.         if ($this->receivedShipments->removeElement($receivedShipment)) {
  810.             // set the owning side to null (unless already changed)
  811.             if ($receivedShipment->getRecipientCustomer() === $this) {
  812.                 $receivedShipment->setRecipientCustomer(null);
  813.             }
  814.         }
  815.         return $this;
  816.     }
  817.     /**
  818.      * @return Collection<int, BankBookItem>
  819.      */
  820.     public function getBankBookItems(): Collection
  821.     {
  822.         return $this->bankBookItems;
  823.     }
  824.     public function addBankBookItem(BankBookItem $bankBookItem): self
  825.     {
  826.         if (!$this->bankBookItems->contains($bankBookItem)) {
  827.             $this->bankBookItems->add($bankBookItem);
  828.             $bankBookItem->setCustomer($this);
  829.         }
  830.         return $this;
  831.     }
  832.     public function removeBankBookItem(BankBookItem $bankBookItem): self
  833.     {
  834.         if ($this->bankBookItems->removeElement($bankBookItem)) {
  835.             // set the owning side to null (unless already changed)
  836.             if ($bankBookItem->getCustomer() === $this) {
  837.                 $bankBookItem->setCustomer(null);
  838.             }
  839.         }
  840.         return $this;
  841.     }
  842.     /**
  843.      * @return Collection<int, CashOnDelivery>
  844.      */
  845.     public function getCashOnDeliveries(): Collection
  846.     {
  847.         return $this->cashOnDeliveries;
  848.     }
  849.     public function addCashOnDelivery(CashOnDelivery $cashOnDelivery): self
  850.     {
  851.         if (!$this->cashOnDeliveries->contains($cashOnDelivery)) {
  852.             $this->cashOnDeliveries->add($cashOnDelivery);
  853.             $cashOnDelivery->setCustomer($this);
  854.         }
  855.         return $this;
  856.     }
  857.     public function removeCashOnDelivery(CashOnDelivery $cashOnDelivery): self
  858.     {
  859.         if ($this->cashOnDeliveries->removeElement($cashOnDelivery)) {
  860.             // set the owning side to null (unless already changed)
  861.             if ($cashOnDelivery->getCustomer() === $this) {
  862.                 $cashOnDelivery->setCustomer(null);
  863.             }
  864.         }
  865.         return $this;
  866.     }
  867.     /**
  868.      * @return Collection<int, ProductSubscription>
  869.      */
  870.     public function getProductSubscriptions(): Collection
  871.     {
  872.         return $this->productSubscriptions;
  873.     }
  874.     public function addProductSubscription(ProductSubscription $productSubscription): self
  875.     {
  876.         if (!$this->productSubscriptions->contains($productSubscription)) {
  877.             $this->productSubscriptions->add($productSubscription);
  878.             $productSubscription->setCustomer($this);
  879.         }
  880.         return $this;
  881.     }
  882.     public function removeProductSubscription(ProductSubscription $productSubscription): self
  883.     {
  884.         if ($this->productSubscriptions->removeElement($productSubscription)) {
  885.             // set the owning side to null (unless already changed)
  886.             if ($productSubscription->getCustomer() === $this) {
  887.                 $productSubscription->setCustomer(null);
  888.             }
  889.         }
  890.         return $this;
  891.     }
  892.     public function getStore(): ?Store
  893.     {
  894.         return $this->store;
  895.     }
  896.     public function setStore(?Store $store): self
  897.     {
  898.         $this->store $store;
  899.         return $this;
  900.     }
  901.     /**
  902.      * @return Collection<int, Invoice>
  903.      */
  904.     public function getInvoices(): Collection
  905.     {
  906.         return $this->invoices;
  907.     }
  908.     public function addInvoice(Invoice $invoice): self
  909.     {
  910.         if (!$this->invoices->contains($invoice)) {
  911.             $this->invoices->add($invoice);
  912.             $invoice->setCustomer($this);
  913.         }
  914.         return $this;
  915.     }
  916.     public function removeInvoice(Invoice $invoice): self
  917.     {
  918.         if ($this->invoices->removeElement($invoice)) {
  919.             // set the owning side to null (unless already changed)
  920.             if ($invoice->getCustomer() === $this) {
  921.                 $invoice->setCustomer(null);
  922.             }
  923.         }
  924.         return $this;
  925.     }
  926.     public function getCollectAddress(): ?string
  927.     {
  928.         return $this->collectAddress;
  929.     }
  930.     public function setCollectAddress(?string $collectAddress): self
  931.     {
  932.         $this->collectAddress $collectAddress;
  933.         return $this;
  934.     }
  935.     public function getShippingAddress(): ?string
  936.     {
  937.         return $this->shippingAddress;
  938.     }
  939.     public function setShippingAddress(?string $shippingAddress): self
  940.     {
  941.         $this->shippingAddress $shippingAddress;
  942.         return $this;
  943.     }
  944.     public function getCollectLat(): ?string
  945.     {
  946.         return $this->collectLat;
  947.     }
  948.     public function setCollectLat(?string $collectLat): self
  949.     {
  950.         $this->collectLat $collectLat;
  951.         return $this;
  952.     }
  953.     public function getCollectLng(): ?string
  954.     {
  955.         return $this->collectLng;
  956.     }
  957.     public function setCollectLng(string $collectLng): self
  958.     {
  959.         $this->collectLng $collectLng;
  960.         return $this;
  961.     }
  962.     public function getShippingLng(): ?string
  963.     {
  964.         return $this->shippingLng;
  965.     }
  966.     public function setShippingLng(?string $shippingLng): self
  967.     {
  968.         $this->shippingLng $shippingLng;
  969.         return $this;
  970.     }
  971.     /**
  972.      * @return Collection<int, Complaint>
  973.      */
  974.     public function getComplaints(): Collection
  975.     {
  976.         return $this->complaints;
  977.     }
  978.     public function addComplaint(Complaint $complaint): self
  979.     {
  980.         if (!$this->complaints->contains($complaint)) {
  981.             $this->complaints->add($complaint);
  982.             $complaint->setCustomer($this);
  983.         }
  984.         return $this;
  985.     }
  986.     public function removeComplaint(Complaint $complaint): self
  987.     {
  988.         if ($this->complaints->removeElement($complaint)) {
  989.             // set the owning side to null (unless already changed)
  990.             if ($complaint->getCustomer() === $this) {
  991.                 $complaint->setCustomer(null);
  992.             }
  993.         }
  994.         return $this;
  995.     }
  996.     
  997.      public function getType(): ?string
  998.     {
  999.         return $this->type;
  1000.     }
  1001.     public function setType(?string $type): static
  1002.     {
  1003.         $this->type $type;
  1004.         return $this;
  1005.     }
  1006.     public function getRaisonSociale(): ?string
  1007.     {
  1008.         return $this->Raison_sociale;
  1009.     }
  1010.     public function setRaisonSociale(?string $Raison_sociale): static
  1011.     {
  1012.         $this->Raison_sociale $Raison_sociale;
  1013.         return $this;
  1014.     }
  1015.     public function getIce(): ?string
  1016.     {
  1017.         return $this->Ice;
  1018.     }
  1019.     public function setIce(?string $Ice): static
  1020.     {
  1021.         $this->Ice $Ice;
  1022.         return $this;
  1023.     }
  1024.     public function getAdresse(): ?string
  1025.     {
  1026.         return $this->Adresse;
  1027.     }
  1028.     public function setAdresse(?string $Adresse): static
  1029.     {
  1030.         $this->Adresse $Adresse;
  1031.         return $this;
  1032.     }
  1033.     /**
  1034.      * @return Collection<int, TicketsCustomer>
  1035.      */
  1036.     public function getTicketsCustomers(): Collection
  1037.     {
  1038.         return $this->ticketsCustomers;
  1039.     }
  1040.     public function addTicketsCustomer(TicketsCustomer $ticketsCustomer): static
  1041.     {
  1042.         if (!$this->ticketsCustomers->contains($ticketsCustomer)) {
  1043.             $this->ticketsCustomers->add($ticketsCustomer);
  1044.             $ticketsCustomer->setUserId($this);
  1045.         }
  1046.         return $this;
  1047.     }
  1048.     public function removeTicketsCustomer(TicketsCustomer $ticketsCustomer): static
  1049.     {
  1050.         if ($this->ticketsCustomers->removeElement($ticketsCustomer)) {
  1051.             // set the owning side to null (unless already changed)
  1052.             if ($ticketsCustomer->getUserId() === $this) {
  1053.                 $ticketsCustomer->setUserId(null);
  1054.             }
  1055.         }
  1056.         return $this;
  1057.     }
  1058.     
  1059.    
  1060.     public function getSectorActivity(): ?string
  1061.     {
  1062.         return $this->Sector_activity;
  1063.     }
  1064.     public function setSectorActivity(?string $Sector_activity): static
  1065.     {
  1066.         $this->Sector_activity $Sector_activity;
  1067.         return $this;
  1068.     }
  1069.     public function getJob(): ?string
  1070.     {
  1071.         return $this->job;
  1072.     }
  1073.     public function setJob(?string $job): static
  1074.     {
  1075.         $this->job $job;
  1076.         return $this;
  1077.     }
  1078.       /**
  1079.      * Get the value of canReceiveSms
  1080.      */ 
  1081.     public function getCanAcceptCommunity()
  1082.     {
  1083.         return $this->can_accept_community;
  1084.     }
  1085.     /**
  1086.      * Set the value of canReceiveSms
  1087.      *
  1088.      * @return  self
  1089.      */ 
  1090.     public function setCanAcceptCommunity($can_accept_community)
  1091.     {
  1092.         $this->can_accept_community $can_accept_community;
  1093.         return $this;
  1094.     }
  1095. }