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.     /**
  323.      * @ORM\Column(type="string", length=255, nullable=true)
  324.      * @JMS\Expose()
  325.      */
  326.     private ?string $companyLegalForm null;
  327.     /** @ORM\PrePersist() */
  328.     public function prePersist()
  329.     {
  330.         $this->createdAt = new \DateTime();
  331.     }
  332.     /** @ORM\PreUpdate() */
  333.     public function preUpdate()
  334.     {
  335.         $this->updatedAt = new \DateTime();
  336.     }
  337.     public function __clone() {
  338.         if ($this->id) {
  339.             $this->setId(null);
  340.         }
  341.     }
  342.     public function __toString()
  343.     {
  344.         if ($this->companyName){
  345.             return (string)$this->companyName;
  346.         }else{
  347.             return (string)$this->firstName;
  348.         }
  349.     }
  350.     public function hasCorrespondenceAddress()
  351.     {
  352.         if (
  353.             empty($this->correspondenceName)
  354.             || empty($this->correspondenceAddress)
  355.             || empty($this->correspondenceHouseNumber)
  356.             || empty($this->correspondenceCity)
  357.             || empty($this->correspondencePostalcode)
  358.         )
  359.         {
  360.             return false;
  361.         }
  362.         return true;
  363.     }
  364.     public function removeDeliveryAddressProduct()
  365.     {
  366.         $this
  367.             ->setDeliveryAddressProductEmail(null)
  368.             ->setDeliveryAddressProductPhoneNumber(null)
  369.             ->setDeliveryAddressProductAddress(null)
  370.             ->setDeliveryAddressProductHouseNumber(null)
  371.             ->setDeliveryAddressProductApartmentNumber(null)
  372.             ->setDeliveryAddressProductCity(null)
  373.             ->setDeliveryAddressProductCompanyName(null)
  374.             ->setDeliveryAddressProductFirstName(null)
  375.             ->setDeliveryAddressProductLastName(null)
  376.             ->setDeliveryAddressProductPostalCode(null);
  377.         return $this;
  378.     }
  379.     public function removeCorrespondenceAddress(): self
  380.     {
  381.         $this
  382.             ->setCorrespondenceName(null)
  383.             ->setCorrespondenceFirstName(null)
  384.             ->setCorrespondenceLastName(null)
  385.             ->setCorrespondenceAddress(null)
  386.             ->setCorrespondenceHouseNumber(null)
  387.             ->setCorrespondenceApartmentNumber(null)
  388.             ->setCorrespondenceCity(null)
  389.             ->setCorrespondencePostalcode(null);
  390.         return $this;
  391.     }
  392.     public function prepareAddressForPrivatePerson(bool $removeDeliveryAddress true)
  393.     {
  394.         $this
  395.             ->setCompanyName(null)
  396.             ->setNip(null)
  397.             ->setWhoPay('buyer');
  398.         if ($removeDeliveryAddress)
  399.         {
  400.             $this->removeDeliveryAddressProduct();
  401.         }
  402.         return $this;
  403.     }
  404.     public function prepareAddressForBusiness()
  405.     {
  406.         $this->setWhoPay('buyer');
  407.         // GOS-1101 // $this->removeDeliveryAddressProduct();
  408.         return $this;
  409.     }
  410.     public function hasDeliveryAddressProduct()
  411.     {
  412.         if (
  413.             empty($this->deliveryAddressProductEmail)
  414.             || empty($this->deliveryAddressProductPhoneNumber)
  415.             || empty($this->deliveryAddressProductFirstName)
  416.             || empty($this->deliveryAddressProductLastName)
  417.             || empty($this->deliveryAddressProductAddress)
  418.             || empty($this->deliveryAddressProductHouseNumber)
  419.             || empty($this->deliveryAddressProductPostalCode)
  420.             || empty($this->deliveryAddressProductCity)
  421.         )
  422.         {
  423.             return false;
  424.         }
  425.         return true;
  426.     }
  427.     public function getObjectVars()
  428.     {
  429.         return get_object_vars($this);
  430.     }
  431.     /**
  432.      * Set id
  433.      *
  434.      * @return Cart
  435.      */
  436.     public function setId($id)
  437.     {
  438.         $this->id $id;
  439.         return $this;
  440.     }
  441.     /**
  442.      * Get id
  443.      *
  444.      * @return int
  445.      */
  446.     public function getId()
  447.     {
  448.         return $this->id;
  449.     }
  450.     /**
  451.      * Set companyName
  452.      *
  453.      * @param string $companyName
  454.      *
  455.      * @return Address
  456.      */
  457.     public function setCompanyName($companyName)
  458.     {
  459.         $this->companyName $companyName;
  460.         return $this;
  461.     }
  462.     /**
  463.      * Get companyName
  464.      *
  465.      * @return string
  466.      */
  467.     public function getCompanyName()
  468.     {
  469.         return $this->companyName;
  470.     }
  471.     /**
  472.      * Set nip
  473.      *
  474.      * @param string $nip
  475.      *
  476.      * @return Address
  477.      */
  478.     public function setNip($nip)
  479.     {
  480.         $this->nip $nip;
  481.         return $this;
  482.     }
  483.     /**
  484.      * Get nip
  485.      *
  486.      * @return string
  487.      */
  488.     public function getNip()
  489.     {
  490.         return $this->nip;
  491.     }
  492.     /**
  493.      * Set firstName
  494.      *
  495.      * @param string $firstName
  496.      *
  497.      * @return Address
  498.      */
  499.     public function setFirstName($firstName)
  500.     {
  501.         $this->firstName $firstName;
  502.         return $this;
  503.     }
  504.     /**
  505.      * Get firstName
  506.      *
  507.      * @return string
  508.      */
  509.     public function getFirstName()
  510.     {
  511.         return $this->firstName;
  512.     }
  513.     /**
  514.      * Set lastName
  515.      *
  516.      * @param string $lastName
  517.      *
  518.      * @return Address
  519.      */
  520.     public function setLastName($lastName)
  521.     {
  522.         $this->lastName $lastName;
  523.         return $this;
  524.     }
  525.     /**
  526.      * Get lastName
  527.      *
  528.      * @return string
  529.      */
  530.     public function getLastName()
  531.     {
  532.         return $this->lastName;
  533.     }
  534.     public function getFullName(): string
  535.     {
  536.         return trim($this->getFirstName().' '.$this->getLastName());
  537.     }
  538.     /**
  539.      * Set address
  540.      *
  541.      * @param string $address
  542.      *
  543.      * @return Address
  544.      */
  545.     public function setAddress($address)
  546.     {
  547.         $this->address $address;
  548.         return $this;
  549.     }
  550.     /**
  551.      * Get address
  552.      *
  553.      * @return string
  554.      */
  555.     public function getAddress()
  556.     {
  557.         return $this->address;
  558.     }
  559.     public function getFullAddress(): string
  560.     {
  561.         return $this->getAddress().' '.$this->getHouseNumber().
  562.             ( $this->getApartmentNumber() ? '/'.$this->getApartmentNumber() : '' );
  563.     }
  564.     /**
  565.      * @param $houseNumber
  566.      * @return $this
  567.      */
  568.     public function setHouseNumber($houseNumber)
  569.     {
  570.         $this->houseNumber $houseNumber;
  571.         return $this;
  572.     }
  573.     /**
  574.      * @return string
  575.      */
  576.     public function getHouseNumber()
  577.     {
  578.         return $this->houseNumber;
  579.     }
  580.     public function getApartmentNumber(): ?string
  581.     {
  582.         return $this->apartmentNumber;
  583.     }
  584.     public function setApartmentNumber(?string $apartmentNumber): Address
  585.     {
  586.         $this->apartmentNumber $apartmentNumber;
  587.         return $this;
  588.     }
  589.     /**
  590.      * Set city
  591.      *
  592.      * @param string $city
  593.      *
  594.      * @return Address
  595.      */
  596.     public function setCity($city)
  597.     {
  598.         $this->city $city;
  599.         return $this;
  600.     }
  601.     /**
  602.      * Get city
  603.      *
  604.      * @return string
  605.      */
  606.     public function getCity()
  607.     {
  608.         return $this->city;
  609.     }
  610.     /**
  611.      * Set postalCode
  612.      *
  613.      * @param string $postalCode
  614.      *
  615.      * @return Address
  616.      */
  617.     public function setPostalCode($postalCode)
  618.     {
  619.         $this->postalCode $postalCode;
  620.         return $this;
  621.     }
  622.     /**
  623.      * Get postalCode
  624.      *
  625.      * @return string
  626.      */
  627.     public function getPostalCode()
  628.     {
  629.         return $this->postalCode;
  630.     }
  631.     /**
  632.      * Set phone
  633.      *
  634.      * @param string $phone
  635.      *
  636.      * @return Address
  637.      */
  638.     public function setPhone($phone)
  639.     {
  640.         $this->phone $phone;
  641.         return $this;
  642.     }
  643.     /**
  644.      * Get phone
  645.      *
  646.      * @return string
  647.      */
  648.     public function getPhone()
  649.     {
  650.         return $this->phone;
  651.     }
  652.     /**
  653.      * Set position
  654.      *
  655.      * @param string $position
  656.      *
  657.      * @return Address
  658.      */
  659.     public function setPosition($position)
  660.     {
  661.         $this->position $position;
  662.         return $this;
  663.     }
  664.     /**
  665.      * Get position
  666.      *
  667.      * @return string
  668.      */
  669.     public function getPosition()
  670.     {
  671.         return $this->position;
  672.     }
  673.     /**
  674.      * Set correspondenceName
  675.      *
  676.      * @param string $correspondenceName
  677.      *
  678.      * @return Address
  679.      */
  680.     public function setCorrespondenceName($correspondenceName)
  681.     {
  682.         $this->correspondenceName $correspondenceName;
  683.         return $this;
  684.     }
  685.     /**
  686.      * Get correspondenceName
  687.      *
  688.      * @return string
  689.      */
  690.     public function getCorrespondenceName()
  691.     {
  692.         return $this->correspondenceName;
  693.     }
  694.     /**
  695.      * Set correspondenceAddress
  696.      *
  697.      * @param string $correspondenceAddress
  698.      *
  699.      * @return Address
  700.      */
  701.     public function setCorrespondenceAddress($correspondenceAddress)
  702.     {
  703.         $this->correspondenceAddress $correspondenceAddress;
  704.         return $this;
  705.     }
  706.     public function getCorrespondenceFirstName(): ?string
  707.     {
  708.         return $this->correspondenceFirstName;
  709.     }
  710.     public function setCorrespondenceFirstName(?string $correspondenceFirstName): self
  711.     {
  712.         $this->correspondenceFirstName $correspondenceFirstName;
  713.         return $this;
  714.     }
  715.     public function getCorrespondenceLastName(): ?string
  716.     {
  717.         return $this->correspondenceLastName;
  718.     }
  719.     public function getCorrespondenceFullName(): string
  720.     {
  721.         return trim($this->getCorrespondenceFirstName().' '.$this->getCorrespondenceLastName());
  722.     }
  723.     public function setCorrespondenceLastName(?string $correspondenceLastName): self
  724.     {
  725.         $this->correspondenceLastName $correspondenceLastName;
  726.         return $this;
  727.     }
  728.     /**
  729.      * Get correspondenceAddress
  730.      *
  731.      * @return string
  732.      */
  733.     public function getCorrespondenceAddress()
  734.     {
  735.         return $this->correspondenceAddress;
  736.     }
  737.     public function getCorrespondenceFullAddress(): string
  738.     {
  739.         return $this->getCorrespondenceAddress().' '.$this->getCorrespondenceHouseNumber().
  740.             ( $this->getCorrespondenceApartmentNumber() ? '/'.$this->getCorrespondenceApartmentNumber() : '' );
  741.     }
  742.     /**
  743.      * @param $correspondenceHouseNumber
  744.      * @return $this
  745.      */
  746.     public function setCorrespondenceHouseNumber($correspondenceHouseNumber)
  747.     {
  748.         $this->correspondenceHouseNumber $correspondenceHouseNumber;
  749.         return $this;
  750.     }
  751.     /**
  752.      * @return string
  753.      */
  754.     public function getCorrespondenceHouseNumber()
  755.     {
  756.         return $this->correspondenceHouseNumber;
  757.     }
  758.     public function getCorrespondenceApartmentNumber(): ?string
  759.     {
  760.         return $this->correspondenceApartmentNumber;
  761.     }
  762.     public function setCorrespondenceApartmentNumber(?string $correspondenceApartmentNumber): Address
  763.     {
  764.         $this->correspondenceApartmentNumber $correspondenceApartmentNumber;
  765.         return $this;
  766.     }
  767.     /**
  768.      * Set correspondenceCity
  769.      *
  770.      * @param string $correspondenceCity
  771.      *
  772.      * @return Address
  773.      */
  774.     public function setCorrespondenceCity($correspondenceCity)
  775.     {
  776.         $this->correspondenceCity $correspondenceCity;
  777.         return $this;
  778.     }
  779.     /**
  780.      * Get correspondenceCity
  781.      *
  782.      * @return string
  783.      */
  784.     public function getCorrespondenceCity()
  785.     {
  786.         return $this->correspondenceCity;
  787.     }
  788.     /**
  789.      * Set correspondencePostalcode
  790.      *
  791.      * @param string $correspondencePostalcode
  792.      *
  793.      * @return Address
  794.      */
  795.     public function setCorrespondencePostalcode($correspondencePostalcode)
  796.     {
  797.         $this->correspondencePostalcode $correspondencePostalcode;
  798.         return $this;
  799.     }
  800.     /**
  801.      * Get correspondencePostalcode
  802.      *
  803.      * @return string
  804.      */
  805.     public function getCorrespondencePostalcode()
  806.     {
  807.         return $this->correspondencePostalcode;
  808.     }
  809.     /**
  810.      * Set publicFunding
  811.      *
  812.      * @param boolean $publicFunding
  813.      *
  814.      * @return Address
  815.      */
  816.     public function setPublicFunding($publicFunding)
  817.     {
  818.         $this->publicFunding $publicFunding;
  819.         return $this;
  820.     }
  821.     /**
  822.      * Get publicFunding
  823.      *
  824.      * @return bool
  825.      */
  826.     public function getPublicFunding()
  827.     {
  828.         return $this->publicFunding;
  829.     }
  830.     /**
  831.      * Set createdAt
  832.      *
  833.      * @param \DateTime $createdAt
  834.      *
  835.      * @return Address
  836.      */
  837.     public function setCreatedAt($createdAt)
  838.     {
  839.         $this->createdAt $createdAt;
  840.         return $this;
  841.     }
  842.     /**
  843.      * Get createdAt
  844.      *
  845.      * @return \DateTime
  846.      */
  847.     public function getCreatedAt()
  848.     {
  849.         return $this->createdAt;
  850.     }
  851.     /**
  852.      * Set updatedAt
  853.      *
  854.      * @param \DateTime $updatedAt
  855.      *
  856.      * @return Address
  857.      */
  858.     public function setUpdatedAt($updatedAt)
  859.     {
  860.         $this->updatedAt $updatedAt;
  861.         return $this;
  862.     }
  863.     /**
  864.      * Get updatedAt
  865.      *
  866.      * @return \DateTime
  867.      */
  868.     public function getUpdatedAt()
  869.     {
  870.         return $this->updatedAt;
  871.     }
  872.     /**
  873.      * Constructor
  874.      */
  875.     public function __construct()
  876.     {
  877.         $this->cart = new \Doctrine\Common\Collections\ArrayCollection();
  878.         $this->orders = new ArrayCollection();
  879.         $this->userTemporary = new ArrayCollection();
  880.     }
  881.     /**
  882.      * Add cart
  883.      *
  884.      * @param \App\Entity\Gos\Cart $cart
  885.      *
  886.      * @return Address
  887.      */
  888.     public function addCart(\App\Entity\Gos\Cart $cart)
  889.     {
  890.         $this->cart[] = $cart;
  891.         return $this;
  892.     }
  893.     /**
  894.      * Remove cart
  895.      *
  896.      * @param \App\Entity\Gos\Cart $cart
  897.      */
  898.     public function removeCart(\App\Entity\Gos\Cart $cart)
  899.     {
  900.         $this->cart->removeElement($cart);
  901.     }
  902.     /**
  903.      * Get cart
  904.      *
  905.      * @return \Doctrine\Common\Collections\Collection
  906.      */
  907.     public function getCart()
  908.     {
  909.         return $this->cart;
  910.     }
  911.     /**
  912.      * Set clientType
  913.      *
  914.      * @param \App\Entity\Gos\ClientType $clientType
  915.      *
  916.      * @return Address
  917.      */
  918.     public function setClientType(\App\Entity\Gos\ClientType $clientType null)
  919.     {
  920.         $this->clientType $clientType;
  921.         return $this;
  922.     }
  923.     /**
  924.      * Get clientType
  925.      *
  926.      * @return \App\Entity\Gos\ClientType
  927.      */
  928.     public function getClientType()
  929.     {
  930.         return $this->clientType;
  931.     }
  932.     public function getClientTypeSlug()
  933.     {
  934.         if ($this->clientType)
  935.         {
  936.             return $this->getClientType()->getSlug();
  937.         }
  938.         return null;
  939.     }
  940.     /**
  941.      * Set user
  942.      *
  943.      * @param \App\Entity\Gos\User $user
  944.      *
  945.      * @return Address
  946.      */
  947.     public function setUser(\App\Entity\Gos\User $user null)
  948.     {
  949.         $this->user $user;
  950.         return $this;
  951.     }
  952.     /**
  953.      * Get user
  954.      *
  955.      * @return \App\Entity\Gos\User
  956.      */
  957.     public function getUser()
  958.     {
  959.         return $this->user;
  960.     }
  961.     /**
  962.      * Set orders
  963.      *
  964.      * @param \App\Entity\Gos\Orders $orders
  965.      *
  966.      * @return Address
  967.      */
  968.     public function setOrders(\App\Entity\Gos\Orders $orders null)
  969.     {
  970.         $this->orders $orders;
  971.         return $this;
  972.     }
  973.     /**
  974.      * Get orders
  975.      *
  976.      * @return \App\Entity\Gos\Orders
  977.      */
  978.     public function getOrders()
  979.     {
  980.         return $this->orders;
  981.     }
  982.     /**
  983.      * Add order
  984.      *
  985.      * @param \App\Entity\Gos\Orders $order
  986.      *
  987.      * @return Address
  988.      */
  989.     public function addOrder(\App\Entity\Gos\Orders $order)
  990.     {
  991.         $this->orders[] = $order;
  992.         return $this;
  993.     }
  994.     /**
  995.      * Remove order
  996.      *
  997.      * @param \App\Entity\Gos\Orders $order
  998.      */
  999.     public function removeOrder(\App\Entity\Gos\Orders $order)
  1000.     {
  1001.         $this->orders->removeElement($order);
  1002.     }
  1003.     public function getWhoPay(): ?string
  1004.     {
  1005.         return $this->whoPay;
  1006.     }
  1007.     public function setWhoPay(?string $whoPay): self
  1008.     {
  1009.         $this->whoPay $whoPay;
  1010.         return $this;
  1011.     }
  1012.     public function getDeliveryAddressProductFirstName(): ?string
  1013.     {
  1014.         return $this->deliveryAddressProductFirstName;
  1015.     }
  1016.     public function setDeliveryAddressProductFirstName(?string $deliveryAddressProductFirstName): self
  1017.     {
  1018.         $this->deliveryAddressProductFirstName $deliveryAddressProductFirstName;
  1019.         return $this;
  1020.     }
  1021.     public function getDeliveryAddressProductLastName(): ?string
  1022.     {
  1023.         return $this->deliveryAddressProductLastName;
  1024.     }
  1025.     public function getDeliveryAddressProductFullName(): string
  1026.     {
  1027.         return trim($this->getDeliveryAddressProductFirstName().' '.$this->getDeliveryAddressProductLastName());
  1028.     }
  1029.     public function setDeliveryAddressProductLastName(?string $deliveryAddressProductLastName): self
  1030.     {
  1031.         $this->deliveryAddressProductLastName $deliveryAddressProductLastName;
  1032.         return $this;
  1033.     }
  1034.     public function getDeliveryAddressProductCompanyName(): ?string
  1035.     {
  1036.         return $this->deliveryAddressProductCompanyName;
  1037.     }
  1038.     public function setDeliveryAddressProductCompanyName(?string $deliveryAddressProductCompanyName): self
  1039.     {
  1040.         $this->deliveryAddressProductCompanyName $deliveryAddressProductCompanyName;
  1041.         return $this;
  1042.     }
  1043.     public function getDeliveryAddressProductAddress(): ?string
  1044.     {
  1045.         return $this->deliveryAddressProductAddress;
  1046.     }
  1047.     public function getDeliveryAddressProductFullAddress(): string
  1048.     {
  1049.         return trim(
  1050.             $this->getDeliveryAddressProductAddress().' '.$this->getDeliveryAddressProductHouseNumber().
  1051.             ( $this->getDeliveryAddressProductApartmentNumber() ? '/'.$this->getDeliveryAddressProductApartmentNumber() : '' )
  1052.         );
  1053.     }
  1054.     public function setDeliveryAddressProductAddress(?string $deliveryAddressProductAddress): self
  1055.     {
  1056.         $this->deliveryAddressProductAddress $deliveryAddressProductAddress;
  1057.         return $this;
  1058.     }
  1059.     /**
  1060.      * @return null|string
  1061.      */
  1062.     public function getDeliveryAddressProductHouseNumber(): ?string
  1063.     {
  1064.         return $this->deliveryAddressProductHouseNumber;
  1065.     }
  1066.     /**
  1067.      * @param null|string $deliveryAddressProductHouseNumber
  1068.      * @return Address
  1069.      */
  1070.     public function setDeliveryAddressProductHouseNumber(?string $deliveryAddressProductHouseNumber): self
  1071.     {
  1072.         $this->deliveryAddressProductHouseNumber $deliveryAddressProductHouseNumber;
  1073.         return $this;
  1074.     }
  1075.     public function getDeliveryAddressProductApartmentNumber(): ?string
  1076.     {
  1077.         return $this->deliveryAddressProductApartmentNumber;
  1078.     }
  1079.     public function setDeliveryAddressProductApartmentNumber(?string $deliveryAddressProductApartmentNumber): Address
  1080.     {
  1081.         $this->deliveryAddressProductApartmentNumber $deliveryAddressProductApartmentNumber;
  1082.         return $this;
  1083.     }
  1084.     public function getDeliveryAddressProductCity(): ?string
  1085.     {
  1086.         return $this->deliveryAddressProductCity;
  1087.     }
  1088.     public function setDeliveryAddressProductCity(?string $deliveryAddressProductCity): self
  1089.     {
  1090.         $this->deliveryAddressProductCity $deliveryAddressProductCity;
  1091.         return $this;
  1092.     }
  1093.     public function getDeliveryAddressProductPostalCode(): ?string
  1094.     {
  1095.         return $this->deliveryAddressProductPostalCode;
  1096.     }
  1097.     public function setDeliveryAddressProductPostalCode(?string $deliveryAddressProductPostalCode): self
  1098.     {
  1099.         $this->deliveryAddressProductPostalCode $deliveryAddressProductPostalCode;
  1100.         return $this;
  1101.     }
  1102.     public function getUserTemporary()
  1103.     {
  1104.         return $this->userTemporary;
  1105.     }
  1106.     public function setUserTemporary(?UserTemporary $userTemporary): self
  1107.     {
  1108.         $this->userTemporary $userTemporary;
  1109.         // set (or unset) the owning side of the relation if necessary
  1110.         $newAddress $userTemporary === null null $this;
  1111.         if ($newAddress !== $userTemporary->getAddress()) {
  1112.             $userTemporary->setAddress($newAddress);
  1113.         }
  1114.         return $this;
  1115.     }
  1116.     public function addUserTemporary(UserTemporary $userTemporary): self
  1117.     {
  1118.         if (!$this->userTemporary->contains($userTemporary)) {
  1119.             $this->userTemporary[] = $userTemporary;
  1120.             $userTemporary->setAddress($this);
  1121.         }
  1122.         return $this;
  1123.     }
  1124.     public function removeUserTemporary(UserTemporary $userTemporary): self
  1125.     {
  1126.         if ($this->userTemporary->contains($userTemporary)) {
  1127.             $this->userTemporary->removeElement($userTemporary);
  1128.             // set the owning side to null (unless already changed)
  1129.             if ($userTemporary->getAddress() === $this) {
  1130.                 $userTemporary->setAddress(null);
  1131.             }
  1132.         }
  1133.         return $this;
  1134.     }
  1135.     public function getDeliveryAddressProductCountry(): ?Country
  1136.     {
  1137.         return $this->deliveryAddressProductCountry;
  1138.     }
  1139.     public function setDeliveryAddressProductCountry(?Country $deliveryAddressProductCountry): self
  1140.     {
  1141.         $this->deliveryAddressProductCountry $deliveryAddressProductCountry;
  1142.         return $this;
  1143.     }
  1144.     public function getCountry(): ?Country
  1145.     {
  1146.         return $this->country;
  1147.     }
  1148.     public function setCountry(?Country $country): self
  1149.     {
  1150.         $this->country $country;
  1151.         return $this;
  1152.     }
  1153.     public function getNpwz(): ?int
  1154.     {
  1155.         return $this->npwz;
  1156.     }
  1157.     public function setNpwz(?int $npwz): self
  1158.     {
  1159.         $this->npwz $npwz;
  1160.         return $this;
  1161.     }
  1162.     public function getDocumentDistributionChannel(): ?string
  1163.     {
  1164.         return $this->documentDistributionChannel;
  1165.     }
  1166.     public function setDocumentDistributionChannel(?string $documentDistributionChannel): self
  1167.     {
  1168.         $this->documentDistributionChannel $documentDistributionChannel;
  1169.         return $this;
  1170.     }
  1171.     public function getEmailToSendInvoice(): ?string
  1172.     {
  1173.         return $this->emailToSendInvoice;
  1174.     }
  1175.     public function setEmailToSendInvoice(?string $emailToSendInvoice): self
  1176.     {
  1177.         $this->emailToSendInvoice $emailToSendInvoice;
  1178.         return $this;
  1179.     }
  1180.     public function getIsAnotherRecipientAddress(): ?bool
  1181.     {
  1182.         return $this->isAnotherRecipientAddress;
  1183.     }
  1184.     public function setIsAnotherRecipientAddress(?bool $isAnotherRecipientAddress): self
  1185.     {
  1186.         $this->isAnotherRecipientAddress $isAnotherRecipientAddress;
  1187.         return $this;
  1188.     }
  1189.     public function getSendInvoicePaperTo(): ?string
  1190.     {
  1191.         return $this->sendInvoicePaperTo;
  1192.     }
  1193.     public function setSendInvoicePaperTo(?string $sendInvoiceTo): self
  1194.     {
  1195.         $this->sendInvoicePaperTo $sendInvoiceTo;
  1196.         return $this;
  1197.     }
  1198.     public function getHonorific(): ?string
  1199.     {
  1200.         return $this->honorific;
  1201.     }
  1202.     public function setHonorific(?string $honorific): self
  1203.     {
  1204.         $this->honorific $honorific;
  1205.         return $this;
  1206.     }
  1207.     public function getDeliveryAddressProductEmail(): ?string
  1208.     {
  1209.         return $this->deliveryAddressProductEmail;
  1210.     }
  1211.     public function setDeliveryAddressProductEmail(?string $deliveryAddressProductEmail): self
  1212.     {
  1213.         $this->deliveryAddressProductEmail $deliveryAddressProductEmail;
  1214.         return $this;
  1215.     }
  1216.     public function getDeliveryAddressProductPhoneNumber(): ?string
  1217.     {
  1218.         return $this->deliveryAddressProductPhoneNumber;
  1219.     }
  1220.     public function setDeliveryAddressProductPhoneNumber(?string $deliveryAddressProductPhoneNumber): self
  1221.     {
  1222.         $this->deliveryAddressProductPhoneNumber $deliveryAddressProductPhoneNumber;
  1223.         return $this;
  1224.     }
  1225.     public function getCompanyLegalForm(): ?string
  1226.     {
  1227.         return $this->companyLegalForm;
  1228.     }
  1229.     public function setCompanyLegalForm(?string $companyLegalForm): self
  1230.     {
  1231.         $this->companyLegalForm $companyLegalForm;
  1232.         return $this;
  1233.     }
  1234. }