src/Entity/Gos/Address.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use JMS\Serializer\Annotation as JMS;
  7. /**
  8.  * Address
  9.  *
  10.  * @ORM\Table()
  11.  * @ORM\Entity(repositoryClass="App\Repository\AddressRepository")
  12.  * @ORM\HasLifecycleCallbacks
  13.  * @JMS\ExclusionPolicy("all")
  14.  * @JMS\VirtualProperty(
  15.  *     "clientType",
  16.  *     exp="object.getClientTypeSlug()",
  17.  *     options={@JMS\SerializedName("clientType")}
  18.  * )
  19.  */
  20. class Address
  21. {
  22.     /**
  23.      * @var int
  24.      *
  25.      * @ORM\Column(name="id", type="integer")
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="companyName", type="string", length=255, nullable=true)
  34.      * @JMS\Expose()
  35.      */
  36.     private $companyName;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="nip", type="string", length=20, nullable=true)
  41.      * @Assert\Length(max = 20)
  42.      * @JMS\Expose()
  43.      */
  44.     private $nip;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(name="firstName", type="string", length=50, nullable=true)
  49.      * @Assert\Length(max = 50)
  50.      * @JMS\Expose()
  51.      */
  52.     private $firstName;
  53.     /**
  54.      * @var string
  55.      *
  56.      * @ORM\Column(name="lastName", type="string", length=50, nullable=true)
  57.      * @Assert\Length(max = 50)
  58.      * @JMS\Expose()
  59.      */
  60.     private $lastName;
  61.     /**
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="address", type="string", length=255, nullable=true)
  65.      * @JMS\Expose()
  66.      */
  67.     private $address;
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="houseNumber", type="string", length=255, nullable=true)
  72.      * @JMS\Expose()
  73.      */
  74.     private $houseNumber;
  75.     /**
  76.      * @var string
  77.      *
  78.      * @ORM\Column(name="apartmentNumber", type="string", length=255, nullable=true)
  79.      * @JMS\Expose()
  80.      */
  81.     private $apartmentNumber;
  82.     /**
  83.      * @var string
  84.      *
  85.      * @ORM\Column(name="city", type="string", length=100, nullable=true)
  86.      * @Assert\Length(max = 100)
  87.      * @JMS\Expose()
  88.      */
  89.     private $city;
  90.     /**
  91.      * @var string
  92.      *
  93.      * @ORM\Column(name="postalCode", type="string", length=9, nullable=true)
  94.      * @Assert\Length(max = 9)
  95.      * @JMS\Expose()
  96.      */
  97.     private $postalCode;
  98.     /**
  99.      * @var string
  100.      *
  101.      * @ORM\Column(name="phone", type="string", length=30, nullable=true)
  102.      * @Assert\Length(max = 30)
  103.      * @JMS\Expose()
  104.      */
  105.     private $phone;
  106.     /**
  107.      * @var string
  108.      *
  109.      * @ORM\Column(name="position", type="string", length=255, nullable=true)
  110.      * @JMS\Expose()
  111.      */
  112.     private $position;
  113.     /**
  114.      * @var string
  115.      *
  116.      * @ORM\Column(name="correspondenceName", type="string", length=255, nullable=true)
  117.      * @JMS\Expose()
  118.      */
  119.     private $correspondenceName;
  120.     /**
  121.      * @ORM\Column(type="string", length=255, nullable=true)
  122.      * @JMS\Expose()
  123.      */
  124.     private $correspondenceFirstName;
  125.     /**
  126.      * @ORM\Column(type="string", length=255, nullable=true)
  127.      * @JMS\Expose()
  128.      */
  129.     private $correspondenceLastName;
  130.     /**
  131.      * @var string
  132.      *
  133.      * @ORM\Column(name="correspondenceAddress", type="string", length=255, nullable=true)
  134.      * @JMS\Expose()
  135.      */
  136.     private $correspondenceAddress;
  137.     /**
  138.      * @var string
  139.      *
  140.      * @ORM\Column(name="correspondenceHouseNumber", type="string", length=255, nullable=true)
  141.      * @JMS\Expose()
  142.      */
  143.     private $correspondenceHouseNumber;
  144.     /**
  145.      * @var string
  146.      *
  147.      * @ORM\Column(name="correspondenceApartmentNumber", type="string", length=255, nullable=true)
  148.      * @JMS\Expose()
  149.      */
  150.     private $correspondenceApartmentNumber;
  151.     /**
  152.      * @var string
  153.      *
  154.      * @ORM\Column(name="correspondenceCity", type="string", length=255, nullable=true)
  155.      * @JMS\Expose()
  156.      */
  157.     private $correspondenceCity;
  158.     /**
  159.      * @var string
  160.      *
  161.      * @ORM\Column(name="correspondencePostalcode", type="string", length=9, nullable=true)
  162.      * @Assert\Length(max = 9)
  163.      * @JMS\Expose()
  164.      */
  165.     private $correspondencePostalcode;
  166.     /**
  167.      * @var string
  168.      *
  169.      * @ORM\Column(type="string", length=255, nullable=true)
  170.      * @Assert\Length(max = 255)
  171.      * @JMS\Expose()
  172.      */
  173.     private $deliveryAddressProductEmail;
  174.     /**
  175.      * @var string
  176.      *
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      * @Assert\Length(max = 255)
  179.      * @JMS\Expose()
  180.      */
  181.     private $deliveryAddressProductPhoneNumber;
  182.     /**
  183.      * @var string
  184.      *
  185.      * @ORM\Column(type="string", length=50, nullable=true)
  186.      * @Assert\Length(max = 50)
  187.      * @JMS\Expose()
  188.      */
  189.     private $deliveryAddressProductFirstName;
  190.     /**
  191.      * @var string
  192.      *
  193.      * @ORM\Column(type="string", length=50, nullable=true)
  194.      * @Assert\Length(max = 50)
  195.      * @JMS\Expose()
  196.      */
  197.     private $deliveryAddressProductLastName;
  198.     /**
  199.      * @var string
  200.      *
  201.      * @ORM\Column(type="string", length=255, nullable=true)
  202.      * @JMS\Expose()
  203.      */
  204.     private $deliveryAddressProductCompanyName;
  205.     /**
  206.      * @var string
  207.      *
  208.      * @ORM\Column(type="string", length=255, nullable=true)
  209.      * @JMS\Expose()
  210.      */
  211.     private $deliveryAddressProductAddress;
  212.     /**
  213.      * @var string
  214.      *
  215.      * @ORM\Column(type="string", length=255, nullable=true)
  216.      * @JMS\Expose()
  217.      */
  218.     private $deliveryAddressProductHouseNumber;
  219.     /**
  220.      * @var string
  221.      *
  222.      * @ORM\Column(type="string", length=255, nullable=true)
  223.      * @JMS\Expose()
  224.      */
  225.     private $deliveryAddressProductApartmentNumber;
  226.     /**
  227.      * @var string
  228.      *
  229.      * @ORM\Column(type="string", length=100, nullable=true)
  230.      * @Assert\Length(max = 100)
  231.      * @JMS\Expose()
  232.      */
  233.     private $deliveryAddressProductCity;
  234.     /**
  235.      * @var string
  236.      *
  237.      * @ORM\Column(type="string", length=9, nullable=true)
  238.      * @Assert\Length(max = 9)
  239.      * @JMS\Expose()
  240.      */
  241.     private $deliveryAddressProductPostalCode;
  242.     /**
  243.      * @var bool
  244.      *
  245.      * @ORM\Column(name="publicFunding", type="boolean", nullable=true)
  246.      * @JMS\Expose()
  247.      */
  248.     private $publicFunding;
  249.     /**
  250.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Cart", mappedBy="address")
  251.      */
  252.     private $cart;
  253.     /**
  254.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ClientType", inversedBy="address")
  255.      * @ORM\JoinColumn()
  256.      */
  257.     private $clientType;
  258.     /**
  259.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\User", mappedBy="address")
  260.      */
  261.     private $user;
  262.     /**
  263.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UserTemporary", mappedBy="address")
  264.      */
  265.     private $userTemporary;
  266.     /**
  267.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Orders", mappedBy="address")
  268.      */
  269.     private $orders;
  270.     /**
  271.      * @ORM\Column(type="string", length=255, nullable=true, options={"default" : "buyer"})
  272.      * @JMS\Expose()
  273.      */
  274.     private $whoPay;
  275.     /**
  276.      * @ORM\Column(type="datetime")
  277.      */
  278.     private $createdAt;
  279.     /**
  280.      * @ORM\Column(type="datetime", nullable=true)
  281.      */
  282.     private $updatedAt;
  283.     /**
  284.      * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="deliveryAddressProducts")
  285.      */
  286.     private $deliveryAddressProductCountry;
  287.     /**
  288.      * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="addresses")
  289.      */
  290.     private $country;
  291.     /**
  292.      * @ORM\Column(type="integer", nullable=true)
  293.      * @Assert\Positive()
  294.      * @JMS\Expose()
  295.      */
  296.     private $npwz;
  297.     /**
  298.      * @ORM\Column(type="string", length=255, nullable=true)
  299.      * @JMS\Expose()
  300.      */
  301.     private $documentDistributionChannel;
  302.     /**
  303.      * @ORM\Column(type="string", length=255, nullable=true)
  304.      * @JMS\Expose()
  305.      */
  306.     private $emailToSendInvoice;
  307.     /**
  308.      * @ORM\Column(type="boolean", nullable=true)
  309.      * @JMS\Expose()
  310.      */
  311.     private $isAnotherRecipientAddress;
  312.     /**
  313.      * @ORM\Column(type="string", length=255, nullable=true)
  314.      * @JMS\Expose()
  315.      */
  316.     private $sendInvoicePaperTo;
  317.     /**
  318.      * @ORM\Column(type="string", length=255, nullable=true)
  319.      * @JMS\Expose()
  320.      */
  321.     private $honorific;
  322.     /** @ORM\PrePersist() */
  323.     public function prePersist()
  324.     {
  325.         $this->createdAt = new \DateTime();
  326.     }
  327.     /** @ORM\PreUpdate() */
  328.     public function preUpdate()
  329.     {
  330.         $this->updatedAt = new \DateTime();
  331.     }
  332.     public function __clone() {
  333.         if ($this->id) {
  334.             $this->setId(null);
  335.         }
  336.     }
  337.     public function __toString()
  338.     {
  339.         if ($this->companyName){
  340.             return (string)$this->companyName;
  341.         }else{
  342.             return (string)$this->firstName;
  343.         }
  344.     }
  345.     public function hasCorrespondenceAddress()
  346.     {
  347.         if (
  348.             empty($this->correspondenceName)
  349.             || empty($this->correspondenceAddress)
  350.             || empty($this->correspondenceHouseNumber)
  351.             || empty($this->correspondenceCity)
  352.             || empty($this->correspondencePostalcode)
  353.         )
  354.         {
  355.             return false;
  356.         }
  357.         return true;
  358.     }
  359.     public function removeDeliveryAddressProduct()
  360.     {
  361.         $this
  362.             ->setDeliveryAddressProductEmail(null)
  363.             ->setDeliveryAddressProductPhoneNumber(null)
  364.             ->setDeliveryAddressProductAddress(null)
  365.             ->setDeliveryAddressProductHouseNumber(null)
  366.             ->setDeliveryAddressProductApartmentNumber(null)
  367.             ->setDeliveryAddressProductCity(null)
  368.             ->setDeliveryAddressProductCompanyName(null)
  369.             ->setDeliveryAddressProductFirstName(null)
  370.             ->setDeliveryAddressProductLastName(null)
  371.             ->setDeliveryAddressProductPostalCode(null);
  372.         return $this;
  373.     }
  374.     public function removeCorrespondenceAddress(): self
  375.     {
  376.         $this
  377.             ->setCorrespondenceName(null)
  378.             ->setCorrespondenceFirstName(null)
  379.             ->setCorrespondenceLastName(null)
  380.             ->setCorrespondenceAddress(null)
  381.             ->setCorrespondenceHouseNumber(null)
  382.             ->setCorrespondenceApartmentNumber(null)
  383.             ->setCorrespondenceCity(null)
  384.             ->setCorrespondencePostalcode(null);
  385.         return $this;
  386.     }
  387.     public function prepareAddressForPrivatePerson(bool $removeDeliveryAddress true)
  388.     {
  389.         $this
  390.             ->setCompanyName(null)
  391.             ->setNip(null)
  392.             ->setWhoPay('buyer');
  393.         if ($removeDeliveryAddress)
  394.         {
  395.             $this->removeDeliveryAddressProduct();
  396.         }
  397.         return $this;
  398.     }
  399.     public function prepareAddressForBusiness()
  400.     {
  401.         $this->setWhoPay('buyer');
  402.         // GOS-1101 // $this->removeDeliveryAddressProduct();
  403.         return $this;
  404.     }
  405.     public function hasDeliveryAddressProduct()
  406.     {
  407.         if (
  408.             empty($this->deliveryAddressProductEmail)
  409.             || empty($this->deliveryAddressProductPhoneNumber)
  410.             || empty($this->deliveryAddressProductFirstName)
  411.             || empty($this->deliveryAddressProductLastName)
  412.             || empty($this->deliveryAddressProductAddress)
  413.             || empty($this->deliveryAddressProductHouseNumber)
  414.             || empty($this->deliveryAddressProductPostalCode)
  415.             || empty($this->deliveryAddressProductCity)
  416.         )
  417.         {
  418.             return false;
  419.         }
  420.         return true;
  421.     }
  422.     public function getObjectVars()
  423.     {
  424.         return get_object_vars($this);
  425.     }
  426.     /**
  427.      * Set id
  428.      *
  429.      * @return Cart
  430.      */
  431.     public function setId($id)
  432.     {
  433.         $this->id $id;
  434.         return $this;
  435.     }
  436.     /**
  437.      * Get id
  438.      *
  439.      * @return int
  440.      */
  441.     public function getId()
  442.     {
  443.         return $this->id;
  444.     }
  445.     /**
  446.      * Set companyName
  447.      *
  448.      * @param string $companyName
  449.      *
  450.      * @return Address
  451.      */
  452.     public function setCompanyName($companyName)
  453.     {
  454.         $this->companyName $companyName;
  455.         return $this;
  456.     }
  457.     /**
  458.      * Get companyName
  459.      *
  460.      * @return string
  461.      */
  462.     public function getCompanyName()
  463.     {
  464.         return $this->companyName;
  465.     }
  466.     /**
  467.      * Set nip
  468.      *
  469.      * @param string $nip
  470.      *
  471.      * @return Address
  472.      */
  473.     public function setNip($nip)
  474.     {
  475.         $this->nip $nip;
  476.         return $this;
  477.     }
  478.     /**
  479.      * Get nip
  480.      *
  481.      * @return string
  482.      */
  483.     public function getNip()
  484.     {
  485.         return $this->nip;
  486.     }
  487.     /**
  488.      * Set firstName
  489.      *
  490.      * @param string $firstName
  491.      *
  492.      * @return Address
  493.      */
  494.     public function setFirstName($firstName)
  495.     {
  496.         $this->firstName $firstName;
  497.         return $this;
  498.     }
  499.     /**
  500.      * Get firstName
  501.      *
  502.      * @return string
  503.      */
  504.     public function getFirstName()
  505.     {
  506.         return $this->firstName;
  507.     }
  508.     /**
  509.      * Set lastName
  510.      *
  511.      * @param string $lastName
  512.      *
  513.      * @return Address
  514.      */
  515.     public function setLastName($lastName)
  516.     {
  517.         $this->lastName $lastName;
  518.         return $this;
  519.     }
  520.     /**
  521.      * Get lastName
  522.      *
  523.      * @return string
  524.      */
  525.     public function getLastName()
  526.     {
  527.         return $this->lastName;
  528.     }
  529.     public function getFullName(): string
  530.     {
  531.         return trim($this->getFirstName().' '.$this->getLastName());
  532.     }
  533.     /**
  534.      * Set address
  535.      *
  536.      * @param string $address
  537.      *
  538.      * @return Address
  539.      */
  540.     public function setAddress($address)
  541.     {
  542.         $this->address $address;
  543.         return $this;
  544.     }
  545.     /**
  546.      * Get address
  547.      *
  548.      * @return string
  549.      */
  550.     public function getAddress()
  551.     {
  552.         return $this->address;
  553.     }
  554.     public function getFullAddress(): string
  555.     {
  556.         return $this->getAddress().' '.$this->getHouseNumber().
  557.             ( $this->getApartmentNumber() ? '/'.$this->getApartmentNumber() : '' );
  558.     }
  559.     /**
  560.      * @param $houseNumber
  561.      * @return $this
  562.      */
  563.     public function setHouseNumber($houseNumber)
  564.     {
  565.         $this->houseNumber $houseNumber;
  566.         return $this;
  567.     }
  568.     /**
  569.      * @return string
  570.      */
  571.     public function getHouseNumber()
  572.     {
  573.         return $this->houseNumber;
  574.     }
  575.     public function getApartmentNumber(): ?string
  576.     {
  577.         return $this->apartmentNumber;
  578.     }
  579.     public function setApartmentNumber(?string $apartmentNumber): Address
  580.     {
  581.         $this->apartmentNumber $apartmentNumber;
  582.         return $this;
  583.     }
  584.     /**
  585.      * Set city
  586.      *
  587.      * @param string $city
  588.      *
  589.      * @return Address
  590.      */
  591.     public function setCity($city)
  592.     {
  593.         $this->city $city;
  594.         return $this;
  595.     }
  596.     /**
  597.      * Get city
  598.      *
  599.      * @return string
  600.      */
  601.     public function getCity()
  602.     {
  603.         return $this->city;
  604.     }
  605.     /**
  606.      * Set postalCode
  607.      *
  608.      * @param string $postalCode
  609.      *
  610.      * @return Address
  611.      */
  612.     public function setPostalCode($postalCode)
  613.     {
  614.         $this->postalCode $postalCode;
  615.         return $this;
  616.     }
  617.     /**
  618.      * Get postalCode
  619.      *
  620.      * @return string
  621.      */
  622.     public function getPostalCode()
  623.     {
  624.         return $this->postalCode;
  625.     }
  626.     /**
  627.      * Set phone
  628.      *
  629.      * @param string $phone
  630.      *
  631.      * @return Address
  632.      */
  633.     public function setPhone($phone)
  634.     {
  635.         $this->phone $phone;
  636.         return $this;
  637.     }
  638.     /**
  639.      * Get phone
  640.      *
  641.      * @return string
  642.      */
  643.     public function getPhone()
  644.     {
  645.         return $this->phone;
  646.     }
  647.     /**
  648.      * Set position
  649.      *
  650.      * @param string $position
  651.      *
  652.      * @return Address
  653.      */
  654.     public function setPosition($position)
  655.     {
  656.         $this->position $position;
  657.         return $this;
  658.     }
  659.     /**
  660.      * Get position
  661.      *
  662.      * @return string
  663.      */
  664.     public function getPosition()
  665.     {
  666.         return $this->position;
  667.     }
  668.     /**
  669.      * Set correspondenceName
  670.      *
  671.      * @param string $correspondenceName
  672.      *
  673.      * @return Address
  674.      */
  675.     public function setCorrespondenceName($correspondenceName)
  676.     {
  677.         $this->correspondenceName $correspondenceName;
  678.         return $this;
  679.     }
  680.     /**
  681.      * Get correspondenceName
  682.      *
  683.      * @return string
  684.      */
  685.     public function getCorrespondenceName()
  686.     {
  687.         return $this->correspondenceName;
  688.     }
  689.     /**
  690.      * Set correspondenceAddress
  691.      *
  692.      * @param string $correspondenceAddress
  693.      *
  694.      * @return Address
  695.      */
  696.     public function setCorrespondenceAddress($correspondenceAddress)
  697.     {
  698.         $this->correspondenceAddress $correspondenceAddress;
  699.         return $this;
  700.     }
  701.     public function getCorrespondenceFirstName(): ?string
  702.     {
  703.         return $this->correspondenceFirstName;
  704.     }
  705.     public function setCorrespondenceFirstName(?string $correspondenceFirstName): self
  706.     {
  707.         $this->correspondenceFirstName $correspondenceFirstName;
  708.         return $this;
  709.     }
  710.     public function getCorrespondenceLastName(): ?string
  711.     {
  712.         return $this->correspondenceLastName;
  713.     }
  714.     public function getCorrespondenceFullName(): string
  715.     {
  716.         return trim($this->getCorrespondenceFirstName().' '.$this->getCorrespondenceLastName());
  717.     }
  718.     public function setCorrespondenceLastName(?string $correspondenceLastName): self
  719.     {
  720.         $this->correspondenceLastName $correspondenceLastName;
  721.         return $this;
  722.     }
  723.     /**
  724.      * Get correspondenceAddress
  725.      *
  726.      * @return string
  727.      */
  728.     public function getCorrespondenceAddress()
  729.     {
  730.         return $this->correspondenceAddress;
  731.     }
  732.     public function getCorrespondenceFullAddress(): string
  733.     {
  734.         return $this->getCorrespondenceAddress().' '.$this->getCorrespondenceHouseNumber().
  735.             ( $this->getCorrespondenceApartmentNumber() ? '/'.$this->getCorrespondenceApartmentNumber() : '' );
  736.     }
  737.     /**
  738.      * @param $correspondenceHouseNumber
  739.      * @return $this
  740.      */
  741.     public function setCorrespondenceHouseNumber($correspondenceHouseNumber)
  742.     {
  743.         $this->correspondenceHouseNumber $correspondenceHouseNumber;
  744.         return $this;
  745.     }
  746.     /**
  747.      * @return string
  748.      */
  749.     public function getCorrespondenceHouseNumber()
  750.     {
  751.         return $this->correspondenceHouseNumber;
  752.     }
  753.     public function getCorrespondenceApartmentNumber(): ?string
  754.     {
  755.         return $this->correspondenceApartmentNumber;
  756.     }
  757.     public function setCorrespondenceApartmentNumber(?string $correspondenceApartmentNumber): Address
  758.     {
  759.         $this->correspondenceApartmentNumber $correspondenceApartmentNumber;
  760.         return $this;
  761.     }
  762.     /**
  763.      * Set correspondenceCity
  764.      *
  765.      * @param string $correspondenceCity
  766.      *
  767.      * @return Address
  768.      */
  769.     public function setCorrespondenceCity($correspondenceCity)
  770.     {
  771.         $this->correspondenceCity $correspondenceCity;
  772.         return $this;
  773.     }
  774.     /**
  775.      * Get correspondenceCity
  776.      *
  777.      * @return string
  778.      */
  779.     public function getCorrespondenceCity()
  780.     {
  781.         return $this->correspondenceCity;
  782.     }
  783.     /**
  784.      * Set correspondencePostalcode
  785.      *
  786.      * @param string $correspondencePostalcode
  787.      *
  788.      * @return Address
  789.      */
  790.     public function setCorrespondencePostalcode($correspondencePostalcode)
  791.     {
  792.         $this->correspondencePostalcode $correspondencePostalcode;
  793.         return $this;
  794.     }
  795.     /**
  796.      * Get correspondencePostalcode
  797.      *
  798.      * @return string
  799.      */
  800.     public function getCorrespondencePostalcode()
  801.     {
  802.         return $this->correspondencePostalcode;
  803.     }
  804.     /**
  805.      * Set publicFunding
  806.      *
  807.      * @param boolean $publicFunding
  808.      *
  809.      * @return Address
  810.      */
  811.     public function setPublicFunding($publicFunding)
  812.     {
  813.         $this->publicFunding $publicFunding;
  814.         return $this;
  815.     }
  816.     /**
  817.      * Get publicFunding
  818.      *
  819.      * @return bool
  820.      */
  821.     public function getPublicFunding()
  822.     {
  823.         return $this->publicFunding;
  824.     }
  825.     /**
  826.      * Set createdAt
  827.      *
  828.      * @param \DateTime $createdAt
  829.      *
  830.      * @return Address
  831.      */
  832.     public function setCreatedAt($createdAt)
  833.     {
  834.         $this->createdAt $createdAt;
  835.         return $this;
  836.     }
  837.     /**
  838.      * Get createdAt
  839.      *
  840.      * @return \DateTime
  841.      */
  842.     public function getCreatedAt()
  843.     {
  844.         return $this->createdAt;
  845.     }
  846.     /**
  847.      * Set updatedAt
  848.      *
  849.      * @param \DateTime $updatedAt
  850.      *
  851.      * @return Address
  852.      */
  853.     public function setUpdatedAt($updatedAt)
  854.     {
  855.         $this->updatedAt $updatedAt;
  856.         return $this;
  857.     }
  858.     /**
  859.      * Get updatedAt
  860.      *
  861.      * @return \DateTime
  862.      */
  863.     public function getUpdatedAt()
  864.     {
  865.         return $this->updatedAt;
  866.     }
  867.     /**
  868.      * Constructor
  869.      */
  870.     public function __construct()
  871.     {
  872.         $this->cart = new \Doctrine\Common\Collections\ArrayCollection();
  873.         $this->orders = new ArrayCollection();
  874.         $this->userTemporary = new ArrayCollection();
  875.     }
  876.     /**
  877.      * Add cart
  878.      *
  879.      * @param \App\Entity\Gos\Cart $cart
  880.      *
  881.      * @return Address
  882.      */
  883.     public function addCart(\App\Entity\Gos\Cart $cart)
  884.     {
  885.         $this->cart[] = $cart;
  886.         return $this;
  887.     }
  888.     /**
  889.      * Remove cart
  890.      *
  891.      * @param \App\Entity\Gos\Cart $cart
  892.      */
  893.     public function removeCart(\App\Entity\Gos\Cart $cart)
  894.     {
  895.         $this->cart->removeElement($cart);
  896.     }
  897.     /**
  898.      * Get cart
  899.      *
  900.      * @return \Doctrine\Common\Collections\Collection
  901.      */
  902.     public function getCart()
  903.     {
  904.         return $this->cart;
  905.     }
  906.     /**
  907.      * Set clientType
  908.      *
  909.      * @param \App\Entity\Gos\ClientType $clientType
  910.      *
  911.      * @return Address
  912.      */
  913.     public function setClientType(\App\Entity\Gos\ClientType $clientType null)
  914.     {
  915.         $this->clientType $clientType;
  916.         return $this;
  917.     }
  918.     /**
  919.      * Get clientType
  920.      *
  921.      * @return \App\Entity\Gos\ClientType
  922.      */
  923.     public function getClientType()
  924.     {
  925.         return $this->clientType;
  926.     }
  927.     public function getClientTypeSlug()
  928.     {
  929.         if ($this->clientType)
  930.         {
  931.             return $this->getClientType()->getSlug();
  932.         }
  933.         return null;
  934.     }
  935.     /**
  936.      * Set user
  937.      *
  938.      * @param \App\Entity\Gos\User $user
  939.      *
  940.      * @return Address
  941.      */
  942.     public function setUser(\App\Entity\Gos\User $user null)
  943.     {
  944.         $this->user $user;
  945.         return $this;
  946.     }
  947.     /**
  948.      * Get user
  949.      *
  950.      * @return \App\Entity\Gos\User
  951.      */
  952.     public function getUser()
  953.     {
  954.         return $this->user;
  955.     }
  956.     /**
  957.      * Set orders
  958.      *
  959.      * @param \App\Entity\Gos\Orders $orders
  960.      *
  961.      * @return Address
  962.      */
  963.     public function setOrders(\App\Entity\Gos\Orders $orders null)
  964.     {
  965.         $this->orders $orders;
  966.         return $this;
  967.     }
  968.     /**
  969.      * Get orders
  970.      *
  971.      * @return \App\Entity\Gos\Orders
  972.      */
  973.     public function getOrders()
  974.     {
  975.         return $this->orders;
  976.     }
  977.     /**
  978.      * Add order
  979.      *
  980.      * @param \App\Entity\Gos\Orders $order
  981.      *
  982.      * @return Address
  983.      */
  984.     public function addOrder(\App\Entity\Gos\Orders $order)
  985.     {
  986.         $this->orders[] = $order;
  987.         return $this;
  988.     }
  989.     /**
  990.      * Remove order
  991.      *
  992.      * @param \App\Entity\Gos\Orders $order
  993.      */
  994.     public function removeOrder(\App\Entity\Gos\Orders $order)
  995.     {
  996.         $this->orders->removeElement($order);
  997.     }
  998.     public function getWhoPay(): ?string
  999.     {
  1000.         return $this->whoPay;
  1001.     }
  1002.     public function setWhoPay(?string $whoPay): self
  1003.     {
  1004.         $this->whoPay $whoPay;
  1005.         return $this;
  1006.     }
  1007.     public function getDeliveryAddressProductFirstName(): ?string
  1008.     {
  1009.         return $this->deliveryAddressProductFirstName;
  1010.     }
  1011.     public function setDeliveryAddressProductFirstName(?string $deliveryAddressProductFirstName): self
  1012.     {
  1013.         $this->deliveryAddressProductFirstName $deliveryAddressProductFirstName;
  1014.         return $this;
  1015.     }
  1016.     public function getDeliveryAddressProductLastName(): ?string
  1017.     {
  1018.         return $this->deliveryAddressProductLastName;
  1019.     }
  1020.     public function getDeliveryAddressProductFullName(): string
  1021.     {
  1022.         return trim($this->getDeliveryAddressProductFirstName().' '.$this->getDeliveryAddressProductLastName());
  1023.     }
  1024.     public function setDeliveryAddressProductLastName(?string $deliveryAddressProductLastName): self
  1025.     {
  1026.         $this->deliveryAddressProductLastName $deliveryAddressProductLastName;
  1027.         return $this;
  1028.     }
  1029.     public function getDeliveryAddressProductCompanyName(): ?string
  1030.     {
  1031.         return $this->deliveryAddressProductCompanyName;
  1032.     }
  1033.     public function setDeliveryAddressProductCompanyName(?string $deliveryAddressProductCompanyName): self
  1034.     {
  1035.         $this->deliveryAddressProductCompanyName $deliveryAddressProductCompanyName;
  1036.         return $this;
  1037.     }
  1038.     public function getDeliveryAddressProductAddress(): ?string
  1039.     {
  1040.         return $this->deliveryAddressProductAddress;
  1041.     }
  1042.     public function getDeliveryAddressProductFullAddress(): string
  1043.     {
  1044.         return trim(
  1045.             $this->getDeliveryAddressProductAddress().' '.$this->getDeliveryAddressProductHouseNumber().
  1046.             ( $this->getDeliveryAddressProductApartmentNumber() ? '/'.$this->getDeliveryAddressProductApartmentNumber() : '' )
  1047.         );
  1048.     }
  1049.     public function setDeliveryAddressProductAddress(?string $deliveryAddressProductAddress): self
  1050.     {
  1051.         $this->deliveryAddressProductAddress $deliveryAddressProductAddress;
  1052.         return $this;
  1053.     }
  1054.     /**
  1055.      * @return null|string
  1056.      */
  1057.     public function getDeliveryAddressProductHouseNumber(): ?string
  1058.     {
  1059.         return $this->deliveryAddressProductHouseNumber;
  1060.     }
  1061.     /**
  1062.      * @param null|string $deliveryAddressProductHouseNumber
  1063.      * @return Address
  1064.      */
  1065.     public function setDeliveryAddressProductHouseNumber(?string $deliveryAddressProductHouseNumber): self
  1066.     {
  1067.         $this->deliveryAddressProductHouseNumber $deliveryAddressProductHouseNumber;
  1068.         return $this;
  1069.     }
  1070.     public function getDeliveryAddressProductApartmentNumber(): ?string
  1071.     {
  1072.         return $this->deliveryAddressProductApartmentNumber;
  1073.     }
  1074.     public function setDeliveryAddressProductApartmentNumber(?string $deliveryAddressProductApartmentNumber): Address
  1075.     {
  1076.         $this->deliveryAddressProductApartmentNumber $deliveryAddressProductApartmentNumber;
  1077.         return $this;
  1078.     }
  1079.     public function getDeliveryAddressProductCity(): ?string
  1080.     {
  1081.         return $this->deliveryAddressProductCity;
  1082.     }
  1083.     public function setDeliveryAddressProductCity(?string $deliveryAddressProductCity): self
  1084.     {
  1085.         $this->deliveryAddressProductCity $deliveryAddressProductCity;
  1086.         return $this;
  1087.     }
  1088.     public function getDeliveryAddressProductPostalCode(): ?string
  1089.     {
  1090.         return $this->deliveryAddressProductPostalCode;
  1091.     }
  1092.     public function setDeliveryAddressProductPostalCode(?string $deliveryAddressProductPostalCode): self
  1093.     {
  1094.         $this->deliveryAddressProductPostalCode $deliveryAddressProductPostalCode;
  1095.         return $this;
  1096.     }
  1097.     public function getUserTemporary()
  1098.     {
  1099.         return $this->userTemporary;
  1100.     }
  1101.     public function setUserTemporary(?UserTemporary $userTemporary): self
  1102.     {
  1103.         $this->userTemporary $userTemporary;
  1104.         // set (or unset) the owning side of the relation if necessary
  1105.         $newAddress $userTemporary === null null $this;
  1106.         if ($newAddress !== $userTemporary->getAddress()) {
  1107.             $userTemporary->setAddress($newAddress);
  1108.         }
  1109.         return $this;
  1110.     }
  1111.     public function addUserTemporary(UserTemporary $userTemporary): self
  1112.     {
  1113.         if (!$this->userTemporary->contains($userTemporary)) {
  1114.             $this->userTemporary[] = $userTemporary;
  1115.             $userTemporary->setAddress($this);
  1116.         }
  1117.         return $this;
  1118.     }
  1119.     public function removeUserTemporary(UserTemporary $userTemporary): self
  1120.     {
  1121.         if ($this->userTemporary->contains($userTemporary)) {
  1122.             $this->userTemporary->removeElement($userTemporary);
  1123.             // set the owning side to null (unless already changed)
  1124.             if ($userTemporary->getAddress() === $this) {
  1125.                 $userTemporary->setAddress(null);
  1126.             }
  1127.         }
  1128.         return $this;
  1129.     }
  1130.     public function getDeliveryAddressProductCountry(): ?Country
  1131.     {
  1132.         return $this->deliveryAddressProductCountry;
  1133.     }
  1134.     public function setDeliveryAddressProductCountry(?Country $deliveryAddressProductCountry): self
  1135.     {
  1136.         $this->deliveryAddressProductCountry $deliveryAddressProductCountry;
  1137.         return $this;
  1138.     }
  1139.     public function getCountry(): ?Country
  1140.     {
  1141.         return $this->country;
  1142.     }
  1143.     public function setCountry(?Country $country): self
  1144.     {
  1145.         $this->country $country;
  1146.         return $this;
  1147.     }
  1148.     public function getNpwz(): ?int
  1149.     {
  1150.         return $this->npwz;
  1151.     }
  1152.     public function setNpwz(?int $npwz): self
  1153.     {
  1154.         $this->npwz $npwz;
  1155.         return $this;
  1156.     }
  1157.     public function getDocumentDistributionChannel(): ?string
  1158.     {
  1159.         return $this->documentDistributionChannel;
  1160.     }
  1161.     public function setDocumentDistributionChannel(?string $documentDistributionChannel): self
  1162.     {
  1163.         $this->documentDistributionChannel $documentDistributionChannel;
  1164.         return $this;
  1165.     }
  1166.     public function getEmailToSendInvoice(): ?string
  1167.     {
  1168.         return $this->emailToSendInvoice;
  1169.     }
  1170.     public function setEmailToSendInvoice(?string $emailToSendInvoice): self
  1171.     {
  1172.         $this->emailToSendInvoice $emailToSendInvoice;
  1173.         return $this;
  1174.     }
  1175.     public function getIsAnotherRecipientAddress(): ?bool
  1176.     {
  1177.         return $this->isAnotherRecipientAddress;
  1178.     }
  1179.     public function setIsAnotherRecipientAddress(?bool $isAnotherRecipientAddress): self
  1180.     {
  1181.         $this->isAnotherRecipientAddress $isAnotherRecipientAddress;
  1182.         return $this;
  1183.     }
  1184.     public function getSendInvoicePaperTo(): ?string
  1185.     {
  1186.         return $this->sendInvoicePaperTo;
  1187.     }
  1188.     public function setSendInvoicePaperTo(?string $sendInvoiceTo): self
  1189.     {
  1190.         $this->sendInvoicePaperTo $sendInvoiceTo;
  1191.         return $this;
  1192.     }
  1193.     public function getHonorific(): ?string
  1194.     {
  1195.         return $this->honorific;
  1196.     }
  1197.     public function setHonorific(?string $honorific): self
  1198.     {
  1199.         $this->honorific $honorific;
  1200.         return $this;
  1201.     }
  1202.     public function getDeliveryAddressProductEmail(): ?string
  1203.     {
  1204.         return $this->deliveryAddressProductEmail;
  1205.     }
  1206.     public function setDeliveryAddressProductEmail(?string $deliveryAddressProductEmail): self
  1207.     {
  1208.         $this->deliveryAddressProductEmail $deliveryAddressProductEmail;
  1209.         return $this;
  1210.     }
  1211.     public function getDeliveryAddressProductPhoneNumber(): ?string
  1212.     {
  1213.         return $this->deliveryAddressProductPhoneNumber;
  1214.     }
  1215.     public function setDeliveryAddressProductPhoneNumber(?string $deliveryAddressProductPhoneNumber): self
  1216.     {
  1217.         $this->deliveryAddressProductPhoneNumber $deliveryAddressProductPhoneNumber;
  1218.         return $this;
  1219.     }
  1220. }