public function testExtractShipping__予め指定されたキーだけが抽出される()
 {
     $helper = new SC_Helper_Purchase();
     $helper->arrShippingKey = array('id', 'name', 'code');
     $arrSrc = array('shipping_id' => '1001', 'shipping_code' => 'cd1001', 'shipping_detail' => 'dt1001', 'shipping_name' => '名称1001');
     $this->expected = array('shipping_id' => '1001', 'shipping_name' => '名称1001', 'shipping_code' => 'cd1001');
     $this->actual = $helper->extractShipping($arrSrc);
     $this->verify();
 }
コード例 #2
0
 /**
  * データの一時登録を行う.
  *
  * 非会員向けの処理
  * @param integer $uniqid 受注一時テーブルのユニークID
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @param SC_FormParam $objFormParam SC_FormParam インスタンス
  * @param boolean $isMultiple 複数配送の場合 true
  */
 function lfRegistData($uniqid, &$objPurchase, &$objCustomer, &$objFormParam, $isMultiple = false)
 {
     $arrParams = $objFormParam->getHashArray();
     // 注文者をお届け先とする配列を取得
     $arrShippingOwn = array();
     $objPurchase->copyFromOrder($arrShippingOwn, $arrParams);
     // 都度入力されたお届け先
     $arrShipping = $objPurchase->extractShipping($arrParams);
     if ($isMultiple) {
         $objPurchase->unsetOneShippingTemp(0);
         $objPurchase->unsetOneShippingTemp(1);
         $objPurchase->saveShippingTemp($arrShippingOwn, 0);
         if ($arrParams['deliv_check'] == '1') {
             $objPurchase->saveShippingTemp($arrShipping, 1);
         }
     } else {
         $objPurchase->unsetAllShippingTemp(true);
         if ($arrParams['deliv_check'] == '1') {
             $objPurchase->saveShippingTemp($arrShipping, 1);
         } else {
             $objPurchase->saveShippingTemp($arrShippingOwn, 0);
         }
     }
     $arrValues = $objFormParam->getDbArray();
     // 登録データの作成
     $arrValues['order_birth'] = SC_Utils_Ex::sfGetTimestamp($arrParams['year'], $arrParams['month'], $arrParams['day']);
     $arrValues['update_date'] = 'CURRENT_TIMESTAMP';
     $arrValues['customer_id'] = '0';
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
 }