vendor/lm/entity/src/Cart/CartHeader.php line 1132

Open in your IDE?
  1. <?php
  2. namespace Lm\Entity\Cart;
  3. use Lm\Entity\Common\Entity;
  4. use Lm\Entity\Customer;
  5. use Lm\Entity\CustomerShippingAddress;
  6. use Lm\Entity\Order\TransactionInterface;
  7. use Lm\Entity\OrderHeader;
  8. use Lm\Entity\PaymentType;
  9. use Lm\Entity\Shipping;
  10. use Lm\Service\Db\SqlService;
  11. class CartHeader extends Entity implements TransactionInterface
  12. {
  13.     const CART_TYPE_NORMAL 1// 購入(加工なし)
  14.     const CART_TYPE_ESTIMATE 2// 見積シミュ(加工あり)
  15.     const CART_TYPE_SAMPLE 3// 貸出しサンプル
  16.     const CART_TYPE_CATALOG 4;// カタログ請求
  17.     /**
  18.      * @var string
  19.      */
  20.     protected $orderSamNouki;
  21.     /**
  22.      * @var string
  23.      */
  24.     protected $orderSamNoukiComment;
  25.     /**
  26.      * @var string
  27.      */
  28.     protected $orderSamSuuryou;
  29.     /**
  30.      * @var string
  31.      */
  32.     protected $orderSamSuuryouComment;
  33.     /**
  34.      * @var string
  35.      */
  36.     protected $orderSamNaire;
  37.     /**
  38.      * @var string
  39.      */
  40.     protected $orderSamNaireDetail;
  41.     /**
  42.      * @var string
  43.      */
  44.     protected $orderSamNaireComment;
  45.     /**
  46.      * @var int
  47.      */
  48.     protected $inputEigyou;
  49.     /**
  50.      * @var string
  51.      */
  52.     protected $userAgent;
  53.     /**
  54.      * @var int
  55.      */
  56.     protected $eccubePaymentId;
  57.     /**
  58.      * @var int
  59.      */
  60.     protected $taxRate;
  61.     /**
  62.      * @var int
  63.      */
  64.     protected $device;
  65.     /**
  66.      * @var int
  67.      */
  68.     protected $siteType;
  69.     /**
  70.      * @var int
  71.      */
  72.     protected $jhouhou;
  73.     /**
  74.      * @var int
  75.      */
  76.     protected $faId;
  77.     /**
  78.      * @var int
  79.      */
  80.     protected $landingPageId;
  81.     /**
  82.      * @var int
  83.      */
  84.     protected $mmagId;
  85.     /**
  86.      * @var int|null
  87.      */
  88.     protected $shubetsu;
  89.     /**
  90.      * @var int
  91.      */
  92.     protected $customerId;
  93.     /**
  94.      * @var int
  95.      */
  96.     protected $zeusTransferType;
  97.     /**
  98.      * @var int
  99.      */
  100.     protected $zeusLinkpointFlg OrderHeader::ZEUS_LINKPOINT_FLG_NO;
  101.     /**
  102.      * @var string
  103.      */
  104.     protected $zeusOrdd;
  105.     /**
  106.      * @var string
  107.      */
  108.     protected $amazonPayId;
  109.     /**
  110.      * @var string
  111.      */
  112.     protected $amazonPayReferenceid;
  113.     /**
  114.      * @var string
  115.      */
  116.     protected $amazonPayChargeid;
  117.     /**
  118.      * @var int
  119.      */
  120.     protected $couponCampaignId;
  121.     /**
  122.      * @var int
  123.      */
  124.     protected $ryoushuushou;
  125.     /**
  126.      * @var string
  127.      */
  128.     protected $Atena;
  129.     /**
  130.      * @var string
  131.      */
  132.     protected $ryoushuushouTadashi;
  133.     /**
  134.      * @var string
  135.      */
  136.     protected $ryoushuushouComment;
  137.     /**
  138.      * @var int|null
  139.      */
  140.     protected $customerShippingAddressId;
  141.     /**
  142.      * @var string
  143.      */
  144.     protected $comment;
  145.     /**
  146.      * @var \DateTime
  147.      */
  148.     protected $CDate;
  149.     /**
  150.      * @var \DateTime
  151.      */
  152.     protected $udate;
  153.     /**
  154.      * @var int
  155.      */
  156.     protected $yoyaku OrderHeader::YOYAKU_NO;
  157.     /**
  158.      * @var int
  159.      */
  160.     protected $yoyakuEx OrderHeader::YOYAKU_EX_UNAVAILABLE;
  161.     /**
  162.      * @var string
  163.      */
  164.     protected $catalogId;
  165.     /**
  166.      * @var CartList[]
  167.      */
  168.     protected $cartListList = [];
  169.     /**
  170.      * @var Customer
  171.      */
  172.     protected $customer;
  173.     /**
  174.      * @var CustomerShippingAddress
  175.      */
  176.     protected $customerShippingAddress;
  177.     /**
  178.      * @var PaymentType
  179.      */
  180.     protected $paymentType;
  181.     /**
  182.      * @var Shipping
  183.      */
  184.     protected $shipping;
  185.     /**
  186.      * @var int
  187.      */
  188.     protected $largeDiscount;
  189.     /**
  190.      * @var int
  191.      */
  192.     protected $sendcharge;
  193.     /**
  194.      * @var int
  195.      */
  196.     protected $sendchargeService;
  197.     /**
  198.      * @var int
  199.      */
  200.     protected $daibiki;
  201.     /**
  202.      * @var int
  203.      */
  204.     protected $orderType;
  205.     /**
  206.      * @var int
  207.      */
  208.     protected $payment;
  209.     /**
  210.      * @var int
  211.      */
  212.     protected $couponDiscount;
  213.     /**
  214.      * @var \DateTime
  215.      */
  216.     protected $orderDate;
  217.     /**
  218.      * @var int
  219.      */
  220.     protected $daibikiService;
  221.     /**
  222.      * @var int
  223.      */
  224.     protected $atobarai;
  225.     /**
  226.      * @var int
  227.      */
  228.     protected $atobaraiService;
  229.     /**
  230.      * @param array $data
  231.      */
  232.     public function __construct($data = [])
  233.     {
  234.         //
  235.         $this->allowEmpty();
  236.         //
  237.         parent::__construct($data);
  238.     }
  239.     /**
  240.      * @return string
  241.      */
  242.     public function getOrderSamNouki()
  243.     {
  244.         return $this->orderSamNouki;
  245.     }
  246.     /**
  247.      * @param string $value
  248.      * @return $this
  249.      */
  250.     public function setOrderSamNouki($value)
  251.     {
  252.         $this->orderSamNouki $value;
  253.         return $this;
  254.     }
  255.     /**
  256.      * @return string
  257.      */
  258.     public function getOrderSamNoukiComment()
  259.     {
  260.         return $this->orderSamNoukiComment;
  261.     }
  262.     /**
  263.      * @param string $value
  264.      * @return $this
  265.      */
  266.     public function setOrderSamNoukiComment($value)
  267.     {
  268.         $this->orderSamNoukiComment $value;
  269.         return $this;
  270.     }
  271.     /**
  272.      * @return string
  273.      */
  274.     public function getOrderSamSuuryou()
  275.     {
  276.         return $this->orderSamSuuryou;
  277.     }
  278.     /**
  279.      * @param string $value
  280.      * @return $this
  281.      */
  282.     public function setOrderSamSuuryou($value)
  283.     {
  284.         $this->orderSamSuuryou $value;
  285.         return $this;
  286.     }
  287.     /**
  288.      * @return string
  289.      */
  290.     public function getOrderSamSuuryouComment()
  291.     {
  292.         return $this->orderSamSuuryouComment;
  293.     }
  294.     /**
  295.      * @param string $value
  296.      * @return $this
  297.      */
  298.     public function setOrderSamSuuryouComment($value)
  299.     {
  300.         $this->orderSamSuuryouComment $value;
  301.         return $this;
  302.     }
  303.     /**
  304.      * @return string
  305.      */
  306.     public function getOrderSamNaire()
  307.     {
  308.         return $this->orderSamNaire;
  309.     }
  310.     /**
  311.      * @param string $value
  312.      * @return $this
  313.      */
  314.     public function setOrderSamNaire($value)
  315.     {
  316.         $this->orderSamNaire $value;
  317.         return $this;
  318.     }
  319.     /**
  320.      * @return string
  321.      */
  322.     public function getOrderSamNaireDetail()
  323.     {
  324.         return $this->orderSamNaireDetail;
  325.     }
  326.     /**
  327.      * @param string $value
  328.      * @return $this
  329.      */
  330.     public function setOrderSamNaireDetail($value)
  331.     {
  332.         $this->orderSamNaireDetail $value;
  333.         return $this;
  334.     }
  335.     /**
  336.      * @return string
  337.      */
  338.     public function getOrderSamNaireComment()
  339.     {
  340.         return $this->orderSamNaireComment;
  341.     }
  342.     /**
  343.      * @param string $value
  344.      * @return $this
  345.      */
  346.     public function setOrderSamNaireComment($value)
  347.     {
  348.         $this->orderSamNaireComment $value;
  349.         return $this;
  350.     }
  351.     /**
  352.      * @return int
  353.      */
  354.     public function getInputEigyou()
  355.     {
  356.         return $this->inputEigyou;
  357.     }
  358.     /**
  359.      * @param int $value
  360.      * @return $this
  361.      */
  362.     public function setInputEigyou($value)
  363.     {
  364.         $this->inputEigyou $value;
  365.         return $this;
  366.     }
  367.     public function getUserAgent()
  368.     {
  369.         return $this->userAgent;
  370.     }
  371.     /**
  372.      * @param string $value
  373.      * @return $this
  374.      */
  375.     public function setUserAgent($value)
  376.     {
  377.         $this->userAgent $value;
  378.         return $this;
  379.     }
  380.     /**
  381.      * @return int
  382.      */
  383.     public function getEccubePaymentId()
  384.     {
  385.         return $this->eccubePaymentId;
  386.     }
  387.     /**
  388.      * @param int $value
  389.      * @return $this
  390.      */
  391.     public function setEccubePaymentId($value)
  392.     {
  393.         $this->eccubePaymentId $value;
  394.         return $this;
  395.     }
  396.     public function getTaxRate()
  397.     {
  398.         return $this->taxRate;
  399.     }
  400.     public function setTaxRate($value)
  401.     {
  402.         $this->taxRate $value;
  403.         return $this;
  404.     }
  405.     /**
  406.      * @return int
  407.      */
  408.     public function getSiteType()
  409.     {
  410.         return $this->siteType;
  411.     }
  412.     /**
  413.      * @param int $value
  414.      * @return $this
  415.      */
  416.     public function setSiteType($value)
  417.     {
  418.         $this->siteType $value;
  419.         return $this;
  420.     }
  421.     /**
  422.      * @return int
  423.      */
  424.     public function getJhouhou()
  425.     {
  426.         return $this->jhouhou;
  427.     }
  428.     /**
  429.      * @param int $jhouhou
  430.      * @return $this
  431.      */
  432.     public function setJhouhou($jhouhou)
  433.     {
  434.         $this->jhouhou $jhouhou;
  435.         return $this;
  436.     }
  437.     /**
  438.      * @return int
  439.      */
  440.     public function getFaId()
  441.     {
  442.         return $this->faId;
  443.     }
  444.     /**
  445.      * @param int $faId
  446.      * @return $this
  447.      */
  448.     public function setFaId($faId)
  449.     {
  450.         $this->faId $faId;
  451.         return $this;
  452.     }
  453.     /**
  454.      * @return int
  455.      */
  456.     public function getLandingPageId()
  457.     {
  458.         return $this->landingPageId;
  459.     }
  460.     /**
  461.      * @param int $landingPageId
  462.      * @return $this
  463.      */
  464.     public function setLandingPageId($landingPageId)
  465.     {
  466.         $this->landingPageId $landingPageId;
  467.         return $this;
  468.     }
  469.     /**
  470.      * @return int
  471.      */
  472.     public function getMmagId()
  473.     {
  474.         return $this->mmagId;
  475.     }
  476.     /**
  477.      * @param int $mmagId
  478.      * @return $this
  479.      */
  480.     public function setMmagId($mmagId)
  481.     {
  482.         $this->mmagId $mmagId;
  483.         return $this;
  484.     }
  485.     /**
  486.      * @return PaymentType
  487.      * @throws \Exception
  488.      */
  489.     public function getPaymentType()
  490.     {
  491.         //
  492.         return self::compute($this->payment, function () {
  493.             //
  494.             return PaymentType::getInstance($this->getPayment());
  495.         });
  496.     }
  497.     /**
  498.      * @return int|null
  499.      */
  500.     public function getShubetsu()
  501.     {
  502.         return $this->shubetsu;
  503.     }
  504.     /**
  505.      * @param int|null $shubetsu
  506.      * @return $this
  507.      */
  508.     public function setShubetsu($shubetsu)
  509.     {
  510.         $this->shubetsu $shubetsu;
  511.         return $this;
  512.     }
  513.     /**
  514.      * @return int
  515.      */
  516.     public function getCustomerId()
  517.     {
  518.         return $this->customerId;
  519.     }
  520.     /**
  521.      * @param int $customerId
  522.      * @return $this
  523.      */
  524.     public function setCustomerId($customerId)
  525.     {
  526.         $this->customerId $customerId;
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return int
  531.      */
  532.     public function getZeusTransferType()
  533.     {
  534.         return $this->zeusTransferType;
  535.     }
  536.     /**
  537.      * @param int $zeusTransferType
  538.      * @return $this
  539.      */
  540.     public function setZeusTransferType($zeusTransferType)
  541.     {
  542.         $this->zeusTransferType $zeusTransferType;
  543.         return $this;
  544.     }
  545.     /**
  546.      * @return int
  547.      */
  548.     public function getZeusLinkpointFlg()
  549.     {
  550.         return $this->zeusLinkpointFlg;
  551.     }
  552.     /**
  553.      * @param int $zeusLinkpointFlg
  554.      * @return $this
  555.      */
  556.     public function setZeusLinkpointFlg($zeusLinkpointFlg)
  557.     {
  558.         $this->zeusLinkpointFlg $zeusLinkpointFlg;
  559.         return $this;
  560.     }
  561.     /**
  562.      * @return string
  563.      */
  564.     public function getZeusOrdd()
  565.     {
  566.         return $this->zeusOrdd;
  567.     }
  568.     /**
  569.      * @param string $zeusOrdd
  570.      * @return $this
  571.      */
  572.     public function setZeusOrdd($zeusOrdd)
  573.     {
  574.         $this->zeusOrdd $zeusOrdd;
  575.         return $this;
  576.     }
  577.     /**
  578.      * @return string
  579.      */
  580.     public function getAmazonPayId()
  581.     {
  582.         return $this->amazonPayId;
  583.     }
  584.     /**
  585.      * @param string $amazonPayId
  586.      * @return $this
  587.      */
  588.     public function setAmazonPayId($amazonPayId)
  589.     {
  590.         $this->amazonPayId $amazonPayId;
  591.         return $this;
  592.     }
  593.     /**
  594.      * @return string
  595.      */
  596.     public function getAmazonPayReferenceid()
  597.     {
  598.         return $this->amazonPayReferenceid;
  599.     }
  600.     /**
  601.      * @param string $amazonPayReferenceid
  602.      * @return $this
  603.      */
  604.     public function setAmazonPayReferenceid($amazonPayReferenceid)
  605.     {
  606.         $this->amazonPayReferenceid $amazonPayReferenceid;
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return string
  611.      */
  612.     public function getAmazonPayChargeid()
  613.     {
  614.         return $this->amazonPayChargeid;
  615.     }
  616.     /**
  617.      * @param string $amazonPayChargeid
  618.      * @return $this
  619.      */
  620.     public function setAmazonPayChargeid($amazonPayChargeid)
  621.     {
  622.         $this->amazonPayChargeid $amazonPayChargeid;
  623.         return $this;
  624.     }
  625.     /**
  626.      * @return int
  627.      */
  628.     public function getCouponCampaignId()
  629.     {
  630.         return $this->couponCampaignId;
  631.     }
  632.     /**
  633.      * @param int $couponCampaignId
  634.      * @return $this
  635.      */
  636.     public function setCouponCampaignId($couponCampaignId)
  637.     {
  638.         $this->couponCampaignId $couponCampaignId;
  639.         return $this;
  640.     }
  641.     /**
  642.      * @return int
  643.      */
  644.     public function getRyoushuushou()
  645.     {
  646.         return $this->ryoushuushou;
  647.     }
  648.     /**
  649.      * @param int $ryoushuushou
  650.      * @return $this
  651.      */
  652.     public function setRyoushuushou($ryoushuushou)
  653.     {
  654.         $this->ryoushuushou $ryoushuushou;
  655.         return $this;
  656.     }
  657.     /**
  658.      * @return string
  659.      */
  660.     public function getAtena()
  661.     {
  662.         return $this->Atena;
  663.     }
  664.     /**
  665.      * @param string $Atena
  666.      * @return $this
  667.      */
  668.     public function setAtena($Atena)
  669.     {
  670.         $this->Atena $Atena;
  671.         return $this;
  672.     }
  673.     /**
  674.      * @return string
  675.      */
  676.     public function getRyoushuushouTadashi()
  677.     {
  678.         return $this->ryoushuushouTadashi;
  679.     }
  680.     /**
  681.      * @param string $ryoushuushouTadashi
  682.      * @return $this
  683.      */
  684.     public function setRyoushuushouTadashi($ryoushuushouTadashi)
  685.     {
  686.         $this->ryoushuushouTadashi $ryoushuushouTadashi;
  687.         return $this;
  688.     }
  689.     /**
  690.      * @return string
  691.      */
  692.     public function getRyoushuushouComment()
  693.     {
  694.         return $this->ryoushuushouComment;
  695.     }
  696.     /**
  697.      * @param string $ryoushuushouComment
  698.      * @return $this
  699.      */
  700.     public function setRyoushuushouComment($ryoushuushouComment)
  701.     {
  702.         $this->ryoushuushouComment $ryoushuushouComment;
  703.         return $this;
  704.     }
  705.     /**
  706.      * @return int|null
  707.      */
  708.     public function getCustomerShippingAddressId()
  709.     {
  710.         return $this->customerShippingAddressId;
  711.     }
  712.     /**
  713.      * @return string
  714.      */
  715.     public function getSendCompany()
  716.     {
  717.         return $this->sendCompany;
  718.     }
  719.     /**
  720.      * @param string $sendCompany
  721.      * @return $this
  722.      */
  723.     public function setSendCompany($sendCompany)
  724.     {
  725.         //
  726.         $this->sendCompany $sendCompany;
  727.         //
  728.         return $this;
  729.     }
  730.     /**
  731.      * @return string
  732.      */
  733.     public function getSendName()
  734.     {
  735.         return $this->sendName;
  736.     }
  737.     /**
  738.      * @param string $sendName
  739.      * @return $this
  740.      */
  741.     public function setSendName($sendName)
  742.     {
  743.         //
  744.         $this->sendName $sendName;
  745.         //
  746.         return $this;
  747.     }
  748.     /**
  749.      * @return string
  750.      */
  751.     public function getSendTel()
  752.     {
  753.         return $this->sendTel;
  754.     }
  755.     /**
  756.      * @param string $sendTel
  757.      * @return $this
  758.      */
  759.     public function setSendTel($sendTel)
  760.     {
  761.         //
  762.         $this->sendTel $sendTel;
  763.         //
  764.         return $this;
  765.     }
  766.     /**
  767.      * @return string
  768.      */
  769.     public function getSendPostcode()
  770.     {
  771.         return $this->sendPostcode;
  772.     }
  773.     /**
  774.      * @param string $sendPostcode
  775.      * @return $this
  776.      */
  777.     public function setSendPostcode($sendPostcode)
  778.     {
  779.         //
  780.         $this->sendPostcode $sendPostcode;
  781.         //
  782.         return $this;
  783.     }
  784.     /**
  785.      * @return int
  786.      */
  787.     public function getSendPrefecture()
  788.     {
  789.         return $this->sendPrefecture;
  790.     }
  791.     /**
  792.      * @param string $sendPrefecture
  793.      * @return $this
  794.      */
  795.     public function setSendPrefecture($sendPrefecture)
  796.     {
  797.         //
  798.         $this->sendPrefecture $sendPrefecture;
  799.         //
  800.         return $this;
  801.     }
  802.     /**
  803.      * @return string
  804.      */
  805.     public function getSendAddress1()
  806.     {
  807.         return $this->sendAddress1;
  808.     }
  809.     /**
  810.      * @param string $sendAddress1
  811.      * @return $this
  812.      */
  813.     public function setSendAddress1($sendAddress1)
  814.     {
  815.         //
  816.         $this->sendAddress1 $sendAddress1;
  817.         //
  818.         return $this;
  819.     }
  820.     /**
  821.      * @return string
  822.      */
  823.     public function getSendAddress2()
  824.     {
  825.         return $this->sendAddress2;
  826.     }
  827.     /**
  828.      * @param string $sendAddress2
  829.      * @return $this
  830.      */
  831.     public function setSendAddress2($sendAddress2)
  832.     {
  833.         //
  834.         $this->sendAddress2 $sendAddress2;
  835.         //
  836.         return $this;
  837.     }
  838.     /**
  839.      * @return string
  840.      */
  841.     public function getSendAddress3()
  842.     {
  843.         return $this->sendAddress3;
  844.     }
  845.     /**
  846.      * @param string $sendAddress3
  847.      * @return $this
  848.      */
  849.     public function setSendAddress3($sendAddress3)
  850.     {
  851.         //
  852.         $this->sendAddress3 $sendAddress3;
  853.         //
  854.         return $this;
  855.     }
  856.     /**
  857.      * @param int|null $customerShippingAddressId
  858.      * @return $this
  859.      */
  860.     public function setCustomerShippingAddressId($customerShippingAddressId)
  861.     {
  862.         //
  863.         $this->customerShippingAddressId $customerShippingAddressId;
  864.         //
  865.         return $this;
  866.     }
  867.     /**
  868.      * @return string
  869.      */
  870.     public function getComment()
  871.     {
  872.         return $this->comment;
  873.     }
  874.     /**
  875.      * @param string $comment
  876.      * @return $this
  877.      */
  878.     public function setComment($comment)
  879.     {
  880.         $this->comment $comment;
  881.         return $this;
  882.     }
  883.     /**
  884.      * @return \DateTime
  885.      */
  886.     public function getCDate()
  887.     {
  888.         return $this->CDate;
  889.     }
  890.     /**
  891.      * @param \DateTime $CDate
  892.      * @return $this
  893.      */
  894.     public function setCDate($CDate)
  895.     {
  896.         $this->CDate $CDate;
  897.         return $this;
  898.     }
  899.     /**
  900.      * @return \DateTime
  901.      */
  902.     public function getUdate()
  903.     {
  904.         return $this->udate;
  905.     }
  906.     /**
  907.      * @param \DateTime $udate
  908.      * @return $this
  909.      */
  910.     public function setUdate($udate)
  911.     {
  912.         $this->udate $udate;
  913.         return $this;
  914.     }
  915.     /**
  916.      * @return int
  917.      */
  918.     public function getYoyaku()
  919.     {
  920.         return $this->yoyaku;
  921.     }
  922.     /**
  923.      * @param int $yoyaku
  924.      * @return $this
  925.      */
  926.     public function setYoyaku($yoyaku)
  927.     {
  928.         $this->yoyaku $yoyaku;
  929.         return $this;
  930.     }
  931.     /**
  932.      * @return int
  933.      */
  934.     public function getYoyakuEx()
  935.     {
  936.         return $this->yoyakuEx;
  937.     }
  938.     /**
  939.      * @param int $yoyakuEx
  940.      * @return $this
  941.      */
  942.     public function setYoyakuEx($yoyakuEx)
  943.     {
  944.         $this->yoyakuEx $yoyakuEx;
  945.         return $this;
  946.     }
  947.     /**
  948.      * @return string
  949.      */
  950.     public function getCatalogId()
  951.     {
  952.         return $this->catalogId;
  953.     }
  954.     /**
  955.      * @param string $catalogId
  956.      * @return $this
  957.      */
  958.     public function setCatalogId($catalogId)
  959.     {
  960.         $this->catalogId $catalogId;
  961.         return $this;
  962.     }
  963.     /**
  964.      * @return CartList[]
  965.      */
  966.     public function getCartListList()
  967.     {
  968.         return $this->cartListList;
  969.     }
  970.     /**
  971.      * @param CartList[] $cartListList
  972.      * @return $this
  973.      */
  974.     public function setCartListList($cartListList)
  975.     {
  976.         $this->cartListList $cartListList;
  977.         return $this;
  978.     }
  979.     /**
  980.      * @return int
  981.      */
  982.     public function getDevice()
  983.     {
  984.         return $this->device;
  985.     }
  986.     /**
  987.      * @param int $device
  988.      * @return $this
  989.      */
  990.     public function setDevice($device)
  991.     {
  992.         $this->device $device;
  993.         return $this;
  994.     }
  995.     /**
  996.      * @return Customer
  997.      * @throws \Exception
  998.      */
  999.     public function getCustomer()
  1000.     {
  1001.         //
  1002.         if (empty($this->customer)) {
  1003.             //
  1004.             if ($customer $this->findCustomer()) {
  1005.                 //
  1006.                 $this->customer = new Customer($customer);
  1007.             }
  1008.         }
  1009.         return $this->customer;
  1010.     }
  1011.     /**
  1012.      * @return CustomerShippingAddress
  1013.      * @throws \Exception
  1014.      */
  1015.     public function getCustomerShippingAddress()
  1016.     {
  1017.         //
  1018.         if (empty($this->customerShippingAddress)) {
  1019.             //
  1020.             if ($this->customerShippingAddress $this->findCustomerShippingAddress()) {
  1021.                 //
  1022.                 $this->customerShippingAddress = new CustomerShippingAddress($this->customerShippingAddress);
  1023.             }
  1024.         }
  1025.         return $this->customerShippingAddress;
  1026.     }
  1027.     /**
  1028.      * @param CustomerShippingAddress $customerShippingAddress
  1029.      * @return $this
  1030.      */
  1031.     public function setCustomerShippingAddress(CustomerShippingAddress $customerShippingAddress)
  1032.     {
  1033.         //
  1034.         $this->customerShippingAddress $customerShippingAddress;
  1035.         //
  1036.         return $this;
  1037.     }
  1038.     /**
  1039.      * @return int
  1040.      */
  1041.     public function getCartType()
  1042.     {
  1043.         $cartType CartHeader::CART_TYPE_NORMAL;
  1044.         switch (self::getOrderType()) {
  1045.             case OrderHeader::TYPE_PURCHASE:
  1046.                 if (self::getShubetsu() === 'c') {
  1047.                     $cartType CartHeader::CART_TYPE_NORMAL;
  1048.                 } elseif (self::getShubetsu() === 'm') {
  1049.                     $cartType CartHeader::CART_TYPE_ESTIMATE;
  1050.                 }
  1051.                 break;
  1052.             case OrderHeader::TYPE_SAMPLE:
  1053.                 $cartType CartHeader::CART_TYPE_SAMPLE;
  1054.                 break;
  1055.             case OrderHeader::TYPE_CATALOG:
  1056.                 $cartType CartHeader::CART_TYPE_CATALOG;
  1057.                 break;
  1058.         }
  1059.         return $cartType;
  1060.     }
  1061.     /**
  1062.      * @return array|null
  1063.      */
  1064.     public function findCustomer()
  1065.     {
  1066.         //
  1067.         $customerId $this->getCustomerId();
  1068.         //
  1069.         $result = (new SqlService())
  1070.             ->Table(Customer::TABLE_NAME)
  1071.             ->Set('customer_id'$customerId)
  1072.             ->Find();
  1073.         //
  1074.         return $result;
  1075.     }
  1076.     /**
  1077.      * @return array|null
  1078.      */
  1079.     public function findCustomerShippingAddress()
  1080.     {
  1081.         //
  1082.         $customerShippingAddressId $this->getCustomerShippingAddressId();
  1083.         //
  1084.         $result = (new SqlService())
  1085.             ->Table(CustomerShippingAddress::TABLE_NAME)
  1086.             ->Set('csa_id'$customerShippingAddressId)
  1087.             ->Find();
  1088.         //
  1089.         return $result;
  1090.     }
  1091.     /**
  1092.      * @inheritDoc
  1093.      */
  1094.     public function getSubtotal()
  1095.     {
  1096.         //
  1097.         $subtotal 0;
  1098.         //
  1099.         foreach ($this->getCartListList() as $cartList) {
  1100.             //
  1101.             foreach ($cartList->getCartGoodsListList() as $cartGoodsList) {
  1102.                 //
  1103.                 $subtotal += ($cartGoodsList->getTanka() * $cartGoodsList->getAmount());
  1104.                 $subtotal += $cartGoodsList->getSusoagePrice();
  1105.             }
  1106.             //
  1107.             foreach ($cartList->getCartPrintListList() as $cartPrintList) {
  1108.                 //
  1109.                 foreach ($cartPrintList->getCartPrintDetailList() as $cartPrintDetail) {
  1110.                     //
  1111.                     $subtotal += ($cartPrintDetail->getTanka() * $cartPrintDetail->getAmount());
  1112.                 }
  1113.             }
  1114.             //
  1115.             $subtotal += $cartList->getOlKoguchi();
  1116.         }
  1117.         //
  1118.         return $subtotal;
  1119.     }
  1120.     /**
  1121.      * @return int
  1122.      */
  1123.     public function getLargeDiscount()
  1124.     {
  1125.         //
  1126.         return $this->largeDiscount;
  1127.     }
  1128.     /**
  1129.      * @return int
  1130.      */
  1131.     public function getSendcharge()
  1132.     {
  1133.         //
  1134.         return $this->sendcharge;
  1135.     }
  1136.     /**
  1137.      * @return int
  1138.      */
  1139.     public function getSendchargeService()
  1140.     {
  1141.         //
  1142.         return $this->sendchargeService;
  1143.     }
  1144.     /**
  1145.      * @return int
  1146.      */
  1147.     public function getDaibiki()
  1148.     {
  1149.         //
  1150.         return $this->daibiki;
  1151.     }
  1152.     /**
  1153.      * @return int
  1154.      */
  1155.     public function getDaibikiService()
  1156.     {
  1157.         //
  1158.         return $this->daibikiService;
  1159.     }
  1160.     /**
  1161.      * @return int
  1162.      */
  1163.     public function getAtobarai()
  1164.     {
  1165.         //
  1166.         return $this->atobarai;
  1167.     }
  1168.     /**
  1169.      * @return int
  1170.      */
  1171.     public function getAtobaraiService()
  1172.     {
  1173.         //
  1174.         return $this->atobaraiService;
  1175.     }
  1176.     /**
  1177.      * @inheritDoc
  1178.      */
  1179.     public function getOrderType()
  1180.     {
  1181.         return $this->orderType;
  1182.     }
  1183.     /**
  1184.      * @inheritDoc
  1185.      */
  1186.     public function getPayment()
  1187.     {
  1188.         return $this->payment;
  1189.     }
  1190.     /**
  1191.      * @inheritDoc
  1192.      */
  1193.     public function getCouponDiscount()
  1194.     {
  1195.         return $this->couponDiscount;
  1196.     }
  1197.     /**
  1198.      * @inheritDoc
  1199.      */
  1200.     public function getOrderDate()
  1201.     {
  1202.         return $this->orderDate;
  1203.     }
  1204.     /**
  1205.      * @inheritDoc
  1206.      */
  1207.     public function setLargeDiscount($largeDiscount)
  1208.     {
  1209.         //
  1210.         $this->largeDiscount $largeDiscount;
  1211.         //
  1212.         return $this;
  1213.     }
  1214.     /**
  1215.      * @inheritDoc
  1216.      */
  1217.     public function setSendcharge($sendcharge)
  1218.     {
  1219.         //
  1220.         $this->sendcharge $sendcharge;
  1221.         //
  1222.         return $this;
  1223.     }
  1224.     /**
  1225.      * @inheritDoc
  1226.      */
  1227.     public function setSendchargeService($sendchargeService)
  1228.     {
  1229.         //
  1230.         $this->sendchargeService $sendchargeService;
  1231.         //
  1232.         return $this;
  1233.     }
  1234.     /**
  1235.      * @inheritDoc
  1236.      */
  1237.     public function setDaibiki($daibiki)
  1238.     {
  1239.         //
  1240.         $this->daibiki $daibiki;
  1241.         //
  1242.         return $this;
  1243.     }
  1244.     /**
  1245.      * @inheritDoc
  1246.      */
  1247.     public function setOrderType($orderType)
  1248.     {
  1249.         //
  1250.         $this->orderType $orderType;
  1251.         //
  1252.         return $this;
  1253.     }
  1254.     /**
  1255.      * @inheritDoc
  1256.      */
  1257.     public function setPayment($payment)
  1258.     {
  1259.         //
  1260.         $this->payment $payment;
  1261.         //
  1262.         return $this;
  1263.     }
  1264.     /**
  1265.      * @inheritDoc
  1266.      */
  1267.     public function setCouponDiscount($couponDiscount)
  1268.     {
  1269.         //
  1270.         $this->couponDiscount $couponDiscount;
  1271.         //
  1272.         return $this;
  1273.     }
  1274.     /**
  1275.      * @inheritDoc
  1276.      */
  1277.     public function setOrderDate($orderDate)
  1278.     {
  1279.         //
  1280.         $this->orderDate $orderDate;
  1281.         //
  1282.         return $this;
  1283.     }
  1284.     /**
  1285.      * @inheritDoc
  1286.      */
  1287.     public function getShipping()
  1288.     {
  1289.         return self::compute($this->shipping, function () {
  1290.             //
  1291.             if ($csa $this->getCustomerShippingAddress()) {
  1292.                 return Shipping::getInstance($csa->getCsaCompany(), $csa->getCsaUserName(), $csa->getCsaPostcode(), $csa->getCsaPrefecture(), $csa->getCsaAddress1(), $csa->getCsaAddress2(), $csa->getCsaAddress3(), $csa->getCsaTel(), null);
  1293.             } else {
  1294.                 return null;
  1295.             }
  1296.         });
  1297.     }
  1298.     /**
  1299.      * @inheritDoc
  1300.      */
  1301.     public function setDaibikiService($daibikiService)
  1302.     {
  1303.         //
  1304.         $this->daibikiService $daibikiService;
  1305.         //
  1306.         return $this;
  1307.     }
  1308.     /**
  1309.      * @inheritDoc
  1310.      */
  1311.     public function setAtobarai($atobarai)
  1312.     {
  1313.         //
  1314.         $this->atobarai $atobarai;
  1315.         //
  1316.         return $this;
  1317.     }
  1318.     /**
  1319.      * @inheritDoc
  1320.      */
  1321.     public function setAtobaraiService($atobaraiService)
  1322.     {
  1323.         //
  1324.         $this->atobaraiService $atobaraiService;
  1325.         //
  1326.         return $this;
  1327.     }
  1328. }