当前位置: 首页>>代码示例>>PHP>>正文


PHP DBUtils::buildInsert方法代码示例

本文整理汇总了PHP中DBUtils::buildInsert方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtils::buildInsert方法的具体用法?PHP DBUtils::buildInsert怎么用?PHP DBUtils::buildInsert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBUtils的用法示例。


在下文中一共展示了DBUtils::buildInsert方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveInDatabase

    /**
     * save data in plenty_countries_of_delivery
     * 
     * @param PlentySoapObject_GetCountriesOfDelivery $countryOfDelivery
     */
    private function saveInDatabase($countryOfDelivery)
    {
        $query = 'REPLACE INTO `plenty_countries_of_delivery` 
						' . DBUtils::buildInsert(array('country_id' => $countryOfDelivery->CountryID, 'active' => $countryOfDelivery->CountryActive, 'country_name' => $countryOfDelivery->CountryName, 'iso_code_2' => $countryOfDelivery->CountryISO2));
        $this->getLogger()->debug(__FUNCTION__ . ' save country ' . $countryOfDelivery->CountryISO2 . ' ' . $countryOfDelivery->CountryName);
        DBQuery::getInstance()->replace($query);
    }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:12,代码来源:Adapter_GetCountriesOfDelivery.class.php

示例2: saveToken

 /**
  * save new token to db or file
  * 
  * @param string $soapUser
  * @param string $soapToken
  * @param string $soapUserId
  */
 public function saveToken($soapUser, $soapToken, $soapUserId)
 {
     if (self::SAVE_TOKEN_IN_DB === true) {
         $query = 'REPLACE INTO `plenty_soap_token` ' . DBUtils::buildInsert(array('soap_token_user' => $soapUser, 'soap_token_inserted' => 'NOW()', 'soap_token' => $soapToken, 'soap_token_user_id' => $soapUserId), array('soap_token_inserted'));
         $this->getLogger()->debug(__FUNCTION__ . ' save new token ' . $query);
         DBQuery::getInstance()->replace($query);
     } else {
         $token = array();
         if (is_file($this->dest)) {
             require $this->dest;
         }
         $token[$soapUser] = array('inserted' => strtotime('today'), 'usertoken' => $soapToken, 'userId' => $soapUserId);
         $content = '<?php' . chr(10) . chr(10);
         $content .= '// generated ' . date('r') . chr(10) . chr(10);
         $content .= '$token = ' . var_export($token, true) . ';' . chr(10);
         $content .= '?>' . chr(10);
         file_put_contents($this->dest, $content);
     }
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:26,代码来源:StoreToken.class.php

示例3: saveInDatabase

 /**
  * Save the data in the database
  * 
  * @param PlentySoapObject_SearchOrders $Item
  */
 private function saveInDatabase($Item)
 {
     $query = 'REPLACE INTO `plenty_OrderHead` ' . DBUtils::buildInsert(array('OrderID' => $Item->OrderHead->OrderID, 'Currency' => $Item->OrderHead->Currency, 'CustomerID' => $Item->OrderHead->CustomerID, 'CustomerReference' => $Item->OrderHead->CustomerReference, 'DeliveryAddressID' => $Item->OrderHead->DeliveryAddressID, 'DoneTimestamp' => $Item->OrderHead->DoneTimestamp, 'DunningLevel' => $Item->OrderHead->DunningLevel, 'EbaySellerAccount' => $Item->OrderHead->EbaySellerAccount, 'EstimatedTimeOfShipment' => $Item->OrderHead->EstimatedTimeOfShipment, 'ExchangeRatio' => $Item->OrderHead->ExchangeRatio, 'ExternalOrderID' => $Item->OrderHead->ExternalOrderID, 'Invoice' => $Item->OrderHead->Invoice, 'IsNetto' => $Item->OrderHead->IsNetto, 'LastUpdate' => $Item->OrderHead->LastUpdate, 'MethodOfPaymentID' => $Item->OrderHead->MethodOfPaymentID, 'OrderStatus' => $Item->OrderHead->OrderStatus, 'OrderTimestamp' => $Item->OrderHead->OrderTimestamp, 'OrderType' => $Item->OrderHead->OrderType, 'PackageNumber' => $Item->OrderHead->PackageNumber, 'PaidTimestamp' => $Item->OrderHead->PaidTimestamp, 'ParentOrderID' => $Item->OrderHead->ParentOrderID, 'PaymentStatus' => $Item->OrderHead->PaymentStatus, 'ReferrerID' => $Item->OrderHead->ReferrerID, 'RemoteIP' => $Item->OrderHead->RemoteIP, 'ResponsibleID' => $Item->OrderHead->ResponsibleID, 'SalesAgentID' => $Item->OrderHead->SalesAgentID, 'SellerAccount' => $Item->OrderHead->SellerAccount, 'ShippingCosts' => $Item->OrderHead->ShippingCosts, 'ShippingID' => $Item->OrderHead->ShippingID, 'ShippingMethodID' => $Item->OrderHead->ShippingMethodID, 'ShippingProfileID' => $Item->OrderHead->ShippingProfileID, 'StoreID' => $Item->OrderHead->StoreID, 'TotalBrutto' => $Item->OrderHead->TotalBrutto, 'TotalInvoice' => $Item->OrderHead->TotalInvoice, 'TotalNetto' => $Item->OrderHead->TotalNetto, 'TotalVAT' => $Item->OrderHead->TotalVAT, 'WarehouseID' => $Item->OrderHead->WarehouseID));
     $this->getLogger()->debug(__FUNCTION__ . ' ' . $query);
     DBQuery::getInstance()->replace($query);
     if (isset($Item->OrderHead->IncomingPayments)) {
         foreach ($Item->OrderHead->IncomingPayments->item as $ItemIncomingPayments) {
             $query = 'REPLACE INTO `plenty_OrderHead_IncomingPayments` ' . DBUtils::buildInsert(array('ID' => $ItemIncomingPayments->ID, 'ReferenceID' => $ItemIncomingPayments->ReferenceID, 'OrderID' => $Item->OrderHead->OrderID));
             $this->getLogger()->debug(__FUNCTION__ . ' ' . $query);
             DBQuery::getInstance()->replace($query);
         }
     }
     if (isset($Item->OrderHead->IncomingPayments)) {
         foreach ($Item->OrderHead->IncomingPayments->item as $ItemIncomingPayments) {
             $query = 'REPLACE INTO `plenty_OrderHead_IncomingPayments` ' . DBUtils::buildInsert(array('ID' => $ItemIncomingPayments->ID, 'ReferenceID' => $ItemIncomingPayments->ReferenceID, 'OrderID' => $Item->OrderHead->OrderID));
             $this->getLogger()->debug(__FUNCTION__ . ' ' . $query);
             DBQuery::getInstance()->replace($query);
         }
     }
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:25,代码来源:SoapCall_GetNewOrders.class.php

示例4: saveInDatabase

 /**
  * Save the data in the database
  *
  * @param PlentySoapObject_GetMethodOfPayments $methodOfPayment
  */
 private function saveInDatabase($methodOfPayment)
 {
     $activeCountriesOfDelivery = array();
     $activeMultishops = array();
     /*
      * parse all active countries of delivery in a string
      */
     if (is_array($methodOfPayment->ActiveCountriesOfDelivery->item)) {
         foreach ($methodOfPayment->ActiveCountriesOfDelivery->item as $countryOfDelivery) {
             $activeCountriesOfDelivery[] = $countryOfDelivery->intValue;
         }
     } elseif (is_object($methodOfPayment->ActiveCountriesOfDelivery->item)) {
         $activeCountriesOfDelivery[] = $methodOfPayment->ActiveCountriesOfDelivery->item->intValue;
     }
     /*
      * parse all active multishops in a string
      */
     if (is_array($methodOfPayment->Multishops->item)) {
         foreach ($methodOfPayment->ActiveCountriesOfDelivery->item as $multishops) {
             $activeMultishops[] = $multishops->intValue;
         }
     } elseif (is_object($methodOfPayment->Multishops->item)) {
         $activeMultishops[] = $methodOfPayment->Multishops->item->intValue;
     }
     $query = 'REPLACE INTO `plenty_method_of_payments` ' . DBUtils::buildInsert(array('method_of_payment_id' => $methodOfPayment->MethodOfPaymentID, 'method_of_payment_name' => $methodOfPayment->Name, 'active_countries' => implode(',', $activeCountriesOfDelivery), 'active_multishops' => implode(',', $activeMultishops)));
     $this->getLogger()->debug(__FUNCTION__ . ' new MOP ' . $methodOfPayment->MethodOfPaymentID . ' ' . $methodOfPayment->Name);
     DBQuery::getInstance()->replace($query);
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:33,代码来源:SoapCall_GetMethodOfPayments.class.php

示例5: saveInDatabase

 /**
  * save the data in plenty_vat_config
  * 
  * @param PlentySoapObject_GetVatConfig $vatConfig
  * @param integer $countryId
  */
 private function saveInDatabase($vatConfig, $countryId)
 {
     $query = 'REPLACE INTO `plenty_vat_config` ' . DBUtils::buildInsert(array('country_id' => $countryId, 'vat_id' => $vatConfig->InternalVATID, 'vat_value' => $vatConfig->VATValue));
     $this->getLogger()->debug(__FUNCTION__ . ' save VAT config id:' . $vatConfig->InternalVATID . ' countryId:' . $countryId . ' ' . $vatConfig->VATValue . '%');
     DBQuery::getInstance()->replace($query);
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:12,代码来源:Adapter_GetVATConfig.class.php

示例6: saveInDatabase

 /**
  * Save the data in the database
  *
  * @param PlentySoapObject_GetWarehouseList $warehouse
  */
 private function saveInDatabase($warehouse)
 {
     $query = 'REPLACE INTO `plenty_warehouse` ' . DBUtils::buildInsert(array('warehouse_id' => $warehouse->WarehouseID, 'warehouse_type' => $warehouse->Type, 'warehouse_name' => $warehouse->Name));
     $this->getLogger()->debug(__FUNCTION__ . ' ' . $query);
     DBQuery::getInstance()->replace($query);
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:11,代码来源:SoapCall_GetWarehouseList.class.php

示例7: saveInDatabase

 /**
  * Save the data in plenty_order_status
  *
  * @param PlentySoapObject_GetOrderStatus $orderStatus
  */
 private function saveInDatabase($orderStatus)
 {
     $query = 'REPLACE INTO `plenty_order_status` ' . DBUtils::buildInsert(array('order_status' => $orderStatus->OrderStatus, 'lang' => $this->lang, 'status_name' => $orderStatus->OrderStatusName));
     $this->getLogger()->debug(__FUNCTION__ . ' save status ' . $orderStatus->OrderStatus . ' ' . $orderStatus->OrderStatusName);
     DBQuery::getInstance()->replace($query);
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:11,代码来源:Adapter_GetOrderStatusList.class.php

示例8: saveCurrentTimestamp2DB4TheNextRetrieval

 /**
  * Save $this->currentTimestamp in plenty_stock_last_update
  *
  */
 private function saveCurrentTimestamp2DB4TheNextRetrieval()
 {
     if ($this->warehouseId > 0) {
         $query = 'REPLACE INTO plenty_stock_last_update ' . DBUtils::buildInsert(array('warehouse_id' => $this->warehouseId, 'last_update_timestamp' => $this->currentTimestamp));
         DBQuery::getInstance()->replace($query);
         $this->getLogger()->debug(__FUNCTION__ . ' ' . $query);
     }
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:12,代码来源:Adapter_GetCurrentStocks.class.php


注:本文中的DBUtils::buildInsert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。