src/Service/Checkout/Checkout.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Service\Checkout;
  3. use Symfony\Component\HttpFoundation\RequestStack;
  4. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  5. class Checkout
  6. {
  7.     private SessionInterface $session;
  8.     private $checkout = [];
  9.     public function __construct(RequestStack $rs)
  10.     {
  11.         $this->session $rs->getSession();
  12.         $this->checkout $this->session->get('checkout');
  13.     }
  14.     public function flush()
  15.     {
  16.         $this->session->set('checkout'$this->checkout);
  17.     }
  18.     public function clear()
  19.     {
  20.         $this->session->set('checkout', []);
  21.     }
  22.     /**
  23.      * Get the value of name
  24.      */
  25.     public function getCheckout(): array
  26.     {
  27.         return isset($this->checkout) ? $this->checkout : [];
  28.     }
  29.     /**
  30.      * Get the value of name
  31.      */
  32.     public function getName(): string
  33.     {
  34.         return isset($this->checkout['name']) ? (string) $this->checkout['name'] : '';
  35.     }
  36.     /**
  37.      * Set the value of name
  38.      *
  39.      * @return  self
  40.      */
  41.     public function setName($name)
  42.     {
  43.         $this->checkout['name'] = $name;
  44.         $this->flush();
  45.         return $this;
  46.     }
  47.     /**
  48.      * Get the value of surname
  49.      */
  50.     public function getSurname(): string
  51.     {
  52.         return isset($this->checkout['surname']) ? (string) $this->checkout['surname'] : '';
  53.     }
  54.     /**
  55.      * Set the value of surname
  56.      *
  57.      * @return  self
  58.      */
  59.     public function setSurname($surname)
  60.     {
  61.         $this->checkout['surname'] = $surname;
  62.         $this->flush();
  63.         return $this;
  64.     }
  65.     /**
  66.      * Get the value of gender
  67.      */
  68.     public function getGender(): string
  69.     {
  70.         return isset($this->checkout['gender']) ? (string) $this->checkout['gender'] : '';
  71.     }
  72.     /**
  73.      * Set the value of gender
  74.      *
  75.      * @return  self
  76.      */
  77.     public function setGender($gender)
  78.     {
  79.         $this->checkout['gender'] = $gender;
  80.         $this->flush();
  81.         return $this;
  82.     }
  83.     /**
  84.      * Get the value of email
  85.      */
  86.     public function getEmail(): string
  87.     {
  88.         return isset($this->checkout['email']) ? (string) $this->checkout['email'] : '';
  89.     }
  90.     /**
  91.      * Set the value of email
  92.      *
  93.      * @return  self
  94.      */
  95.     public function setEmail($email)
  96.     {
  97.         $this->checkout['email'] = $email;
  98.         $this->flush();
  99.         return $this;
  100.     }
  101.     /**
  102.      * Get the value of phone
  103.      */
  104.     public function getPhone(): string
  105.     {
  106.         return isset($this->checkout['phone']) ? (string) $this->checkout['phone'] : '';
  107.     }
  108.     /**
  109.      * Set the value of phone
  110.      *
  111.      * @return  self
  112.      */
  113.     public function setPhone($phone)
  114.     {
  115.         $this->checkout['phone'] = $phone;
  116.         $this->flush();
  117.         return $this;
  118.     }
  119.     /**
  120.      * Get the value of key
  121.      */
  122.     public function getKey(): string
  123.     {
  124.         return isset($this->checkout['key']) ? (string) $this->checkout['key'] : '';
  125.     }
  126.     /**
  127.      * Set the value of key
  128.      *
  129.      * @return  self
  130.      */
  131.     public function setKey($key)
  132.     {
  133.         $this->checkout['key'] = $key;
  134.         $this->flush();
  135.         return $this;
  136.     }
  137.     /**
  138.      * Get the value of comment
  139.      */
  140.     public function getComment(): string
  141.     {
  142.         return isset($this->checkout['comment']) ? (string) $this->checkout['comment'] : '';
  143.     }
  144.     /**
  145.      * Set the value of comment
  146.      *
  147.      * @return  self
  148.      */
  149.     public function setComment($comment)
  150.     {
  151.         $this->checkout['comment'] = $comment;
  152.         $this->flush();
  153.         return $this;
  154.     }
  155.     /**
  156.      * Get the value of useraddr
  157.      */
  158.     public function getUseraddr(): string
  159.     {
  160.         return isset($this->checkout['useraddr']) ? (string) $this->checkout['useraddr'] : '';
  161.     }
  162.     /**
  163.      * Set the value of useraddr
  164.      *
  165.      * @return  self
  166.      */
  167.     public function setUseraddr($useraddr)
  168.     {
  169.         $this->checkout['useraddr'] = $useraddr;
  170.         $this->flush();
  171.         return $this;
  172.     }
  173.     /**
  174.      * Get the value of userlat
  175.      */
  176.     public function getUserlat(): string
  177.     {
  178.         return isset($this->checkout['userlat']) ? (string) $this->checkout['userlat'] : '';
  179.     }
  180.     /**
  181.      * Set the value of userlat
  182.      *
  183.      * @return  self
  184.      */
  185.     public function setUserlat($userlat)
  186.     {
  187.         $this->checkout['userlat'] = $userlat;
  188.         $this->flush();
  189.         return $this;
  190.     }
  191.     /**
  192.      * Get the value of userlon
  193.      */
  194.     public function getUserlon(): string
  195.     {
  196.         return isset($this->checkout['userlon']) ? (string) $this->checkout['userlon'] : '';
  197.     }
  198.     /**
  199.      * Set the value of userlon
  200.      *
  201.      * @return  self
  202.      */
  203.     public function setUserlon($userlon)
  204.     {
  205.         $this->checkout['userlon'] = $userlon;
  206.         $this->flush();
  207.         return $this;
  208.     }
  209.     /**
  210.      * Get the value of userflat
  211.      */
  212.     public function getUserflat(): string
  213.     {
  214.         return isset($this->checkout['userflat']) ? (string) $this->checkout['userflat'] : '';
  215.     }
  216.     /**
  217.      * Set the value of userflat
  218.      *
  219.      * @return  self
  220.      */
  221.     public function setUserflat($userflat)
  222.     {
  223.         $this->checkout['userflat'] = $userflat;
  224.         $this->flush();
  225.         return $this;
  226.     }
  227.     /**
  228.      * Get the value of region_fias_id
  229.      */
  230.     public function getRegion_fias_id(): string
  231.     {
  232.         return isset($this->checkout['region_fias_id']) ? (string) $this->checkout['region_fias_id'] : '';
  233.     }
  234.     /**
  235.      * Set the value of region_fias_id
  236.      *
  237.      * @return  self
  238.      */
  239.     public function setRegion_fias_id($region_fias_id)
  240.     {
  241.         $this->checkout['region_fias_id'] = $region_fias_id;
  242.         $this->flush();
  243.         return $this;
  244.     }
  245.     /**
  246.      * Get the value of region_name
  247.      */
  248.     public function getRegion_name(): string
  249.     {
  250.         return isset($this->checkout['region_name']) ? (string) $this->checkout['region_name'] : '';
  251.     }
  252.     /**
  253.      * Set the value of region_fias_id
  254.      *
  255.      * @return  self
  256.      */
  257.     public function setRegion_name($region_name)
  258.     {
  259.         $this->checkout['region_name'] = $region_name;
  260.         $this->flush();
  261.         return $this;
  262.     }
  263.     // -------------------
  264.     /**
  265.      * Get the value of region_fias_id
  266.      */
  267.     public function getCity_fias_id(): string
  268.     {
  269.         return isset($this->checkout['city_fias_id']) ? (string) $this->checkout['city_fias_id'] : '';
  270.     }
  271.     /**
  272.      * Set the value of region_fias_id
  273.      *
  274.      * @return  self
  275.      */
  276.     public function setCity_fias_id($city_fias_id)
  277.     {
  278.         $this->checkout['city_fias_id'] = $city_fias_id;
  279.         $this->flush();
  280.         return $this;
  281.     }
  282.     /**
  283.      * Get the value of region_name
  284.      */
  285.     public function getCity_name(): string
  286.     {
  287.         return isset($this->checkout['city_name']) ? (string) $this->checkout['city_name'] : '';
  288.     }
  289.     /**
  290.      * Set the value of region_fias_id
  291.      *
  292.      * @return  self
  293.      */
  294.     public function setCity_name($city_name)
  295.     {
  296.         $this->checkout['city_name'] = $city_name;
  297.         $this->flush();
  298.         return $this;
  299.     }
  300.     /**
  301.      * Get the value of region_name
  302.      */
  303.     public function getCity_post_code(): string
  304.     {
  305.         return isset($this->checkout['city_post_code']) ? (string) $this->checkout['city_post_code'] : '';
  306.     }
  307.     /**
  308.      * Set the value of region_fias_id
  309.      *
  310.      * @return  self
  311.      */
  312.     public function setCity_post_code($city_post_code)
  313.     {
  314.         $this->checkout['city_post_code'] = $city_post_code;
  315.         $this->flush();
  316.         return $this;
  317.     }
  318.     // --------------------
  319.     /**
  320.      * Get the value of delivery_id
  321.      */
  322.     public function getDelivery_id(): int
  323.     {
  324.         return isset($this->checkout['delivery_id']) ? (int) $this->checkout['delivery_id'] : 0;
  325.     }
  326.     /**
  327.      * Set the value of delivery_id
  328.      *
  329.      * @return  self
  330.      */
  331.     public function setDelivery_id($delivery_id)
  332.     {
  333.         $this->checkout['delivery_id'] = $delivery_id;
  334.         $this->flush();
  335.         return $this;
  336.     }
  337.     /**
  338.      * Get the value of delivery_intname
  339.      */
  340.     public function getDelivery_intname(): string
  341.     {
  342.         return isset($this->checkout['delivery_intname']) ? (string) $this->checkout['delivery_intname'] : '';
  343.     }
  344.     /**
  345.      * Set the value of delivery_intname
  346.      *
  347.      * @return  self
  348.      */
  349.     public function setDelivery_intname($delivery_intname)
  350.     {
  351.         $this->checkout['delivery_intname'] = $delivery_intname;
  352.         $this->flush();
  353.         return $this;
  354.     }
  355.     /**
  356.      * Get the value of delivery_name
  357.      */
  358.     public function getDelivery_name(): string
  359.     {
  360.         return isset($this->checkout['delivery_name']) ? (string) $this->checkout['delivery_name'] : '';
  361.     }
  362.     /**
  363.      * Set the value of delivery_name
  364.      *
  365.      * @return  self
  366.      */
  367.     public function setDelivery_name($delivery_name)
  368.     {
  369.         $this->checkout['delivery_name'] = $delivery_name;
  370.         $this->flush();
  371.         return $this;
  372.     }
  373.     /**
  374.      * Get the value of delivery_post_code
  375.      */
  376.     public function getDelivery_post_code(): string
  377.     {
  378.         return isset($this->checkout['delivery_post_code']) ? (string) $this->checkout['delivery_post_code'] : '';
  379.     }
  380.     /**
  381.      * Set the value of delivery_post_code
  382.      *
  383.      * @return  self
  384.      */
  385.     public function setDelivery_post_code($delivery_post_code)
  386.     {
  387.         $this->checkout['delivery_post_code'] = $delivery_post_code;
  388.         $this->flush();
  389.         return $this;
  390.     }
  391.     /**
  392.      * Get the value of delivery_post_name
  393.      */
  394.     public function getDelivery_post_name(): string
  395.     {
  396.         return isset($this->checkout['delivery_post_name']) ? (string) $this->checkout['delivery_post_name'] : '';
  397.     }
  398.     /**
  399.      * Set the value of delivery_post_name
  400.      *
  401.      * @return  self
  402.      */
  403.     public function setDelivery_post_name($delivery_post_name)
  404.     {
  405.         $this->checkout['delivery_post_name'] = $delivery_post_name;
  406.         $this->flush();
  407.         return $this;
  408.     }
  409.     /**
  410.      * Get the value of delivery_post_worktime
  411.      */
  412.     public function getDelivery_post_worktime(): string
  413.     {
  414.         return isset($this->checkout['delivery_post_worktime']) ? (string) $this->checkout['delivery_post_worktime'] : '';
  415.     }
  416.     /**
  417.      * Set the value of delivery_post_worktime
  418.      *
  419.      * @return  self
  420.      */
  421.     public function setDelivery_post_worktime($delivery_post_worktime)
  422.     {
  423.         $this->checkout['delivery_post_worktime'] = $delivery_post_worktime;
  424.         $this->flush();
  425.         return $this;
  426.     }
  427.     /**
  428.      * Get the value of delivery_post_phone
  429.      */
  430.     public function getDelivery_post_phone(): string
  431.     {
  432.         return isset($this->checkout['delivery_post_phone']) ? (string) $this->checkout['delivery_post_phone'] : '';
  433.     }
  434.     /**
  435.      * Set the value of delivery_post_phone
  436.      *
  437.      * @return  self
  438.      */
  439.     public function setDelivery_post_phone($delivery_post_phone)
  440.     {
  441.         $this->checkout['delivery_post_phone'] = $delivery_post_phone;
  442.         $this->flush();
  443.         return $this;
  444.     }
  445.     /**
  446.      * Get the value of delivery_post_email
  447.      */
  448.     public function getDelivery_post_email(): string
  449.     {
  450.         return isset($this->checkout['delivery_post_email']) ? (string) $this->checkout['delivery_post_email'] : '';
  451.     }
  452.     /**
  453.      * Set the value of delivery_post_email
  454.      *
  455.      * @return  self
  456.      */
  457.     public function setDelivery_post_email($delivery_post_email)
  458.     {
  459.         $this->checkout['delivery_post_email'] = $delivery_post_email;
  460.         $this->flush();
  461.         return $this;
  462.     }
  463.     /**
  464.      * Get the value of delivery_sub_id
  465.      */
  466.     public function getDelivery_sub_id(): int
  467.     {
  468.         return isset($this->checkout['delivery_sub_id']) ? (int) $this->checkout['delivery_sub_id'] : 0;
  469.     }
  470.     /**
  471.      * Set the value of delivery_sub_id
  472.      *
  473.      * @return  self
  474.      */
  475.     public function setDelivery_sub_id($delivery_sub_id)
  476.     {
  477.         $this->checkout['delivery_sub_id'] = (int) $delivery_sub_id;
  478.         $this->flush();
  479.         return $this;
  480.     }
  481.     /**
  482.      * Get the value of delivery_sub_code
  483.      */
  484.     public function getDelivery_sub_code(): string
  485.     {
  486.         return isset($this->checkout['delivery_sub_code']) ? (string) $this->checkout['delivery_sub_code'] : '';
  487.     }
  488.     /**
  489.      * Set the value of delivery_sub_code
  490.      *
  491.      * @return  self
  492.      */
  493.     public function setDelivery_sub_code($delivery_sub_code)
  494.     {
  495.         $this->checkout['delivery_sub_code'] = $delivery_sub_code;
  496.         $this->flush();
  497.         return $this;
  498.     }
  499.     /**
  500.      * Get the value of delivery_sub_name
  501.      */
  502.     public function getDelivery_sub_name(): string
  503.     {
  504.         return isset($this->checkout['delivery_sub_name']) ? (string) $this->checkout['delivery_sub_name'] : '';
  505.     }
  506.     /**
  507.      * Set the value of delivery_sub_name
  508.      *
  509.      * @return  self
  510.      */
  511.     public function setDelivery_sub_name($delivery_sub_name)
  512.     {
  513.         $this->checkout['delivery_sub_name'] = $delivery_sub_name;
  514.         $this->flush();
  515.         return $this;
  516.     }
  517.     /**
  518.      * Get the value of delivery_cost
  519.      */
  520.     public function getDelivery_cost(): int
  521.     {
  522.         return isset($this->checkout['delivery_cost']) ? (int) $this->checkout['delivery_cost'] : 0;
  523.     }
  524.     /**
  525.      * Set the value of delivery_cost
  526.      *
  527.      * @return  self
  528.      */
  529.     public function setDelivery_cost($delivery_cost)
  530.     {
  531.         $this->checkout['delivery_cost'] = $delivery_cost;
  532.         $this->flush();
  533.         return $this;
  534.     }
  535.     /**
  536.      * Get the value of payment_id
  537.      */
  538.     public function getPayment_id(): int
  539.     {
  540.         return isset($this->checkout['payment_id']) ? (int) $this->checkout['payment_id'] : 0;
  541.     }
  542.     /**
  543.      * Set the value of payment_id
  544.      *
  545.      * @return  self
  546.      */
  547.     public function setPayment_id($payment_id)
  548.     {
  549.         $this->checkout['payment_id'] = $payment_id;
  550.         $this->flush();
  551.         return $this;
  552.     }
  553.     /**
  554.      * Get the value of payment_name
  555.      */
  556.     public function getPayment_name(): string
  557.     {
  558.         return isset($this->checkout['payment_name']) ? (string) $this->checkout['payment_name'] : '';
  559.     }
  560.     /**
  561.      * Set the value of payment_name
  562.      *
  563.      * @return  self
  564.      */
  565.     public function setPayment_name($payment_name)
  566.     {
  567.         $this->checkout['payment_name'] = $payment_name;
  568.         $this->flush();
  569.         return $this;
  570.     }
  571.     /**
  572.      * Get the value of lastordertime
  573.      */
  574.     public function getLastOrderTime(): int
  575.     {
  576.         return isset($this->checkout['lastordertime']) ? (int) $this->checkout['lastordertime'] : 0;
  577.     }
  578.     /**
  579.      * Set the value of lastordertime
  580.      *
  581.      * @return  self
  582.      */
  583.     public function setLastOrderTime($lastordertime)
  584.     {
  585.         $this->checkout['lastordertime'] = $lastordertime;
  586.         $this->flush();
  587.         return $this;
  588.     }
  589.     /**
  590.      * Get the value of remarking_cart
  591.      */
  592.     public function getRemarkingCart(): int
  593.     {
  594.         return isset($this->checkout['remarking_cart']) ? (int) $this->checkout['remarking_cart'] : 0;
  595.     }
  596.     /**
  597.      * Set the value of remarking_cart
  598.      *
  599.      * @return  self
  600.      */
  601.     public function setRemarkingCart($remarking_cart)
  602.     {
  603.         $this->checkout['remarking_cart'] = $remarking_cart;
  604.         $this->flush();
  605.         return $this;
  606.     }
  607.     /**
  608.      * Get the value of company_nip
  609.      */
  610.     public function getCompanyNip(): string
  611.     {
  612.         return isset($this->checkout['company_nip']) ? (string) $this->checkout['company_nip'] : '';
  613.     }
  614.     /**
  615.      * Set the value of company_nip
  616.      *
  617.      * @return  self
  618.      */
  619.     public function setCompanyNip($company_nip)
  620.     {
  621.         $this->checkout['company_nip'] = $company_nip;
  622.         $this->flush();
  623.         return $this;
  624.     }
  625.     /**
  626.      * Get the value of company_name
  627.      */
  628.     public function getCompanyName(): string
  629.     {
  630.         return isset($this->checkout['company_name']) ? (string) $this->checkout['company_name'] : '';
  631.     }
  632.     /**
  633.      * Set the value of company_name
  634.      *
  635.      * @return  self
  636.      */
  637.     public function setCompanyName($company_name)
  638.     {
  639.         $this->checkout['company_name'] = $company_name;
  640.         $this->flush();
  641.         return $this;
  642.     }
  643.     /**
  644.      * Get the value of company_index
  645.      */
  646.     public function getCompanyIndex(): string
  647.     {
  648.         return isset($this->checkout['company_index']) ? (string) $this->checkout['company_index'] : '';
  649.     }
  650.     /**
  651.      * Set the value of company_index
  652.      *
  653.      * @return  self
  654.      */
  655.     public function setCompanyIndex($company_index)
  656.     {
  657.         $this->checkout['company_index'] = $company_index;
  658.         $this->flush();
  659.         return $this;
  660.     }
  661.     /**
  662.      * Get the value of company_city
  663.      */
  664.     public function getCompanyCity(): string
  665.     {
  666.         return isset($this->checkout['company_city']) ? (string) $this->checkout['company_city'] : '';
  667.     }
  668.     /**
  669.      * Set the value of company_city
  670.      *
  671.      * @return  self
  672.      */
  673.     public function setCompanyCity($company_city)
  674.     {
  675.         $this->checkout['company_city'] = $company_city;
  676.         $this->flush();
  677.         return $this;
  678.     }
  679.     /**
  680.      * Get the value of company_street
  681.      */
  682.     public function getCompanyStreet(): string
  683.     {
  684.         return isset($this->checkout['company_street']) ? (string) $this->checkout['company_street'] : '';
  685.     }
  686.     /**
  687.      * Set the value of company_street
  688.      *
  689.      * @return  self
  690.      */
  691.     public function setCompanyStreet($company_street)
  692.     {
  693.         $this->checkout['company_street'] = $company_street;
  694.         $this->flush();
  695.         return $this;
  696.     }
  697.     /**
  698.      * Get the value of company_house
  699.      */
  700.     public function getCompanyHouse(): string
  701.     {
  702.         return isset($this->checkout['company_house']) ? (string) $this->checkout['company_house'] : '';
  703.     }
  704.     /**
  705.      * Set the value of company_house
  706.      *
  707.      * @return  self
  708.      */
  709.     public function setCompanyHouse($company_house)
  710.     {
  711.         $this->checkout['company_house'] = $company_house;
  712.         $this->flush();
  713.         return $this;
  714.     }
  715.     /**
  716.      * Get the value of company_flat
  717.      */
  718.     public function getCompanyFlat(): string
  719.     {
  720.         return isset($this->checkout['company_flat']) ? (string) $this->checkout['company_flat'] : '';
  721.     }
  722.     /**
  723.      * Set the value of company_flat
  724.      *
  725.      * @return  self
  726.      */
  727.     public function setCompanyFlat($company_flat)
  728.     {
  729.         $this->checkout['company_flat'] = $company_flat;
  730.         $this->flush();
  731.         return $this;
  732.     }
  733. }