src/Helper/Monetico/Request/OrderContextBilling.php line 118

  1. <?php
  2. namespace App\Helper\Monetico\Request;
  3. class OrderContextBilling implements \JsonSerializable
  4. {
  5.     /**
  6.      * @var ?string
  7.      */
  8.     private $civility;
  9.     /**
  10.      * @var ?string
  11.      */
  12.     private $name;
  13.     /**
  14.      * @var ?string
  15.      */
  16.     private $firstName;
  17.     /**
  18.      * @var ?string
  19.      */
  20.     private $lastName;
  21.     /**
  22.      * @var ?string
  23.      */
  24.     private $middleName;
  25.     /**
  26.      * @var ?string
  27.      */
  28.     private $address;
  29.     /**
  30.      * @var string
  31.      */
  32.     private $addressLine1;
  33.     /**
  34.      * @var ?string
  35.      */
  36.     private $addressLine2;
  37.     /**
  38.      * @var ?string
  39.      */
  40.     private $addressLine3;
  41.     /**
  42.      * @var string
  43.      */
  44.     private $city;
  45.     /**
  46.      * @var string
  47.      */
  48.     private $postalCode;
  49.     /**
  50.      * @var string
  51.      */
  52.     private $country;
  53.     /**
  54.      * @var ?string
  55.      */
  56.     private $stateOrProvince;
  57.     /**
  58.      * @var ?string
  59.      */
  60.     private $countrySubdivision;
  61.     /**
  62.      * @var ?string
  63.      */
  64.     private $email;
  65.     /**
  66.      * @var ?string
  67.      */
  68.     private $phone;
  69.     /**
  70.      * @var ?string
  71.      */
  72.     private $mobilePhone;
  73.     /**
  74.      * @var ?string
  75.      */
  76.     private $homePhone;
  77.     /**
  78.      * @var ?string
  79.      */
  80.     private $workPhone;
  81.     /**
  82.      * OrderContextBilling constructor.
  83.      *
  84.      * @param $addressLine1 string
  85.      * @param $city         string
  86.      * @param $postalCode   string
  87.      * @param $country      string
  88.      */
  89.     public function __construct($addressLine1$city$postalCode$country)
  90.     {
  91.         $this->setAddressLine1($addressLine1);
  92.         $this->setCity($city);
  93.         $this->setPostalCode($postalCode);
  94.         $this->setCountry($country);
  95.     }
  96.     public function jsonSerialize()
  97.     {
  98.         return array_filter([
  99.             "civility" => $this->getCivility(),
  100.             "name" => $this->getName(),
  101.             "firstName" => $this->getFirstName(),
  102.             "lastName" => $this->getLastName(),
  103.             "middleName" => $this->getMiddleName(),
  104.             "address" => $this->getAddress(),
  105.             "addressLine1" => $this->getAddressLine1(),
  106.             "addressLine2" => $this->getAddressLine2(),
  107.             "addressLine3" => $this->getAddressLine3(),
  108.             "city" => $this->getCity(),
  109.             "postalCode" => $this->getPostalCode(),
  110.             "country" => $this->getCountry(),
  111.             "stateOrProvince" => $this->getStateOrProvince(),
  112.             "countrySubdivision" => $this->getCountrySubdivision(),
  113.             "email" => $this->getEmail(),
  114.             "phone" => $this->getPhone(),
  115.             "mobilePhone" => $this->getMobilePhone(),
  116.             "homePhone" => $this->getHomePhone(),
  117.             "workPhone" => $this->getWorkPhone()
  118.         ], function ($value) {
  119.             return !is_null($value);
  120.         });
  121.     }
  122.     /**
  123.      * @return string|null
  124.      */
  125.     public function getCivility(): ?string
  126.     {
  127.         return $this->civility;
  128.     }
  129.     /**
  130.      * @param string|null $civility
  131.      */
  132.     public function setCivility(?string $civility): void
  133.     {
  134.         $this->civility $civility;
  135.     }
  136.     /**
  137.      * @return string|null
  138.      */
  139.     public function getName(): ?string
  140.     {
  141.         return $this->name;
  142.     }
  143.     /**
  144.      * @param string|null $name
  145.      */
  146.     public function setName(?string $name): void
  147.     {
  148.         $this->name $name;
  149.     }
  150.     /**
  151.      * @return string|null
  152.      */
  153.     public function getFirstName(): ?string
  154.     {
  155.         return $this->firstName;
  156.     }
  157.     /**
  158.      * @param string|null $firstName
  159.      */
  160.     public function setFirstName(?string $firstName): void
  161.     {
  162.         $this->firstName $firstName;
  163.     }
  164.     /**
  165.      * @return string|null
  166.      */
  167.     public function getLastName(): ?string
  168.     {
  169.         return $this->lastName;
  170.     }
  171.     /**
  172.      * @param string|null $lastName
  173.      */
  174.     public function setLastName(?string $lastName): void
  175.     {
  176.         $this->lastName $lastName;
  177.     }
  178.     /**
  179.      * @return string|null
  180.      */
  181.     public function getMiddleName(): ?string
  182.     {
  183.         return $this->middleName;
  184.     }
  185.     /**
  186.      * @param string|null $middleName
  187.      */
  188.     public function setMiddleName(?string $middleName): void
  189.     {
  190.         $this->middleName $middleName;
  191.     }
  192.     /**
  193.      * @return string|null
  194.      */
  195.     public function getAddress(): ?string
  196.     {
  197.         return $this->address;
  198.     }
  199.     /**
  200.      * @param string|null $address
  201.      */
  202.     public function setAddress(?string $address): void
  203.     {
  204.         $this->address $address;
  205.     }
  206.     /**
  207.      * @return string
  208.      */
  209.     public function getAddressLine1(): string
  210.     {
  211.         return $this->addressLine1;
  212.     }
  213.     /**
  214.      * @param string $addressLine1
  215.      */
  216.     public function setAddressLine1(string $addressLine1): void
  217.     {
  218.         $this->addressLine1 $addressLine1;
  219.     }
  220.     /**
  221.      * @return string|null
  222.      */
  223.     public function getAddressLine2(): ?string
  224.     {
  225.         return $this->addressLine2;
  226.     }
  227.     /**
  228.      * @param string|null $addressLine2
  229.      */
  230.     public function setAddressLine2(?string $addressLine2): void
  231.     {
  232.         $this->addressLine2 $addressLine2;
  233.     }
  234.     /**
  235.      * @return string|null
  236.      */
  237.     public function getAddressLine3(): ?string
  238.     {
  239.         return $this->addressLine3;
  240.     }
  241.     /**
  242.      * @param string|null $addressLine3
  243.      */
  244.     public function setAddressLine3(?string $addressLine3): void
  245.     {
  246.         $this->addressLine3 $addressLine3;
  247.     }
  248.     /**
  249.      * @return string
  250.      */
  251.     public function getCity(): string
  252.     {
  253.         return $this->city;
  254.     }
  255.     /**
  256.      * @param string $city
  257.      */
  258.     public function setCity(string $city): void
  259.     {
  260.         $this->city $city;
  261.     }
  262.     /**
  263.      * @return string
  264.      */
  265.     public function getPostalCode(): string
  266.     {
  267.         return $this->postalCode;
  268.     }
  269.     /**
  270.      * @param string $postalCode
  271.      */
  272.     public function setPostalCode(string $postalCode): void
  273.     {
  274.         $this->postalCode $postalCode;
  275.     }
  276.     /**
  277.      * @return string
  278.      */
  279.     public function getCountry(): string
  280.     {
  281.         return $this->country;
  282.     }
  283.     /**
  284.      * @param string $country
  285.      */
  286.     public function setCountry(string $country): void
  287.     {
  288.         $this->country $country;
  289.     }
  290.     /**
  291.      * @return string|null
  292.      */
  293.     public function getStateOrProvince(): ?string
  294.     {
  295.         return $this->stateOrProvince;
  296.     }
  297.     /**
  298.      * @param string|null $stateOrProvince
  299.      */
  300.     public function setStateOrProvince(?string $stateOrProvince): void
  301.     {
  302.         $this->stateOrProvince $stateOrProvince;
  303.     }
  304.     /**
  305.      * @return string|null
  306.      */
  307.     public function getCountrySubdivision(): ?string
  308.     {
  309.         return $this->countrySubdivision;
  310.     }
  311.     /**
  312.      * @param string|null $countrySubdivision
  313.      */
  314.     public function setCountrySubdivision(?string $countrySubdivision): void
  315.     {
  316.         $this->countrySubdivision $countrySubdivision;
  317.     }
  318.     /**
  319.      * @return string|null
  320.      */
  321.     public function getEmail(): ?string
  322.     {
  323.         return $this->email;
  324.     }
  325.     /**
  326.      * @param string|null $email
  327.      */
  328.     public function setEmail(?string $email): void
  329.     {
  330.         $this->email $email;
  331.     }
  332.     /**
  333.      * @return string|null
  334.      */
  335.     public function getPhone(): ?string
  336.     {
  337.         return $this->phone;
  338.     }
  339.     /**
  340.      * @param string|null $phone
  341.      */
  342.     public function setPhone(?string $phone): void
  343.     {
  344.         $this->phone $phone;
  345.     }
  346.     /**
  347.      * @return string|null
  348.      */
  349.     public function getMobilePhone(): ?string
  350.     {
  351.         return $this->mobilePhone;
  352.     }
  353.     /**
  354.      * @param string|null $mobilePhone
  355.      */
  356.     public function setMobilePhone(?string $mobilePhone): void
  357.     {
  358.         $this->mobilePhone $mobilePhone;
  359.     }
  360.     /**
  361.      * @return string|null
  362.      */
  363.     public function getHomePhone(): ?string
  364.     {
  365.         return $this->homePhone;
  366.     }
  367.     /**
  368.      * @param string|null $homePhone
  369.      */
  370.     public function setHomePhone(?string $homePhone): void
  371.     {
  372.         $this->homePhone $homePhone;
  373.     }
  374.     /**
  375.      * @return string|null
  376.      */
  377.     public function getWorkPhone(): ?string
  378.     {
  379.         return $this->workPhone;
  380.     }
  381.     /**
  382.      * @param string|null $workPhone
  383.      */
  384.     public function setWorkPhone(?string $workPhone): void
  385.     {
  386.         $this->workPhone $workPhone;
  387.     }
  388. }
  389. ?>