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


PHP Resource::convertField方法代码示例

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


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

示例1: convertField

 /**
  * Convert Customer custom values
  * 
  * @param string $name Field name
  * @param mixed $value Field value
  * @return mixed Converted value
  */
 protected function convertField($name, $value)
 {
     if ($name == 'addresses') {
         $addresses = array();
         foreach ($value as $address) {
             $addresses[] = array('customerAddressID' => $address->customerAddressID, 'customerID' => $address->customerID, 'customerAddressIsDefaultBilling' => $address->customerAddressIsDefaultBilling, 'customerAddressIsDefaultShipping' => $address->customerAddressIsDefaultShipping, 'customerAddressFirstName' => $address->customerAddressFirstName, 'customerAddressLastName' => $address->customerAddressLastName, 'customerAddressCompany' => $address->customerAddressCompany, 'customerAddressLine1' => $address->customerAddressLine1, 'customerAddressLine2' => $address->customerAddressLine2, 'customerAddressCity' => $address->customerAddressCity, 'cityID' => $address->cityID, 'stateCode' => $address->stateCode, 'countryCode' => $address->countryCode, 'customerAddressZip' => $address->customerAddressZip, 'customerAddressPhone' => $address->customerAddressPhone, 'customerAddressFax' => $address->customerAddressFax, 'customerAddressVatNumber' => $address->customerAddressVatNumber, 'customerAddressTaxNumber' => $address->customerAddressTaxNumber, 'customerAddressTaxOffice' => $address->customerAddressTaxOffice, 'customerAddressPersonalNumber' => $address->customerAddressPersonalNumber, 'customerAddressInvoiceContactPerson' => $address->customerAddressInvoiceContactPerson, 'customerAddressIsCompany' => $address->customerAddressIsCompany, 'customerAddressBankName' => $address->customerAddressBankName, 'customerAddressBankAccount' => $address->customerAddressBankAccount);
         }
         return $addresses;
     }
     return parent::convertField($name, $value);
 }
开发者ID:seliton,项目名称:seliton-php-client,代码行数:18,代码来源:Customer.php

示例2: convertField

 /**
  * Convert Order custom values
  *
  * @param string $name Field name
  * @param mixed $value Field value
  * @return mixed Converted value
  */
 protected function convertField($name, $value)
 {
     if ($name == 'items') {
         $items = array();
         foreach ($value as $item) {
             $items[] = array('orderItemID' => $item->orderItemID, 'orderID' => $item->orderID, 'parentOrderItemID' => $item->parentOrderItemID, 'productID' => $item->productID, 'productVariantID' => $item->productVariantID, 'productImageID' => $item->productImageID, 'orderItemProductCode' => $item->orderItemProductCode, 'orderItemProductName' => $item->orderItemProductName, 'orderItemCustomerLanguageProductName' => $item->orderItemCustomerLanguageProductName, 'orderItemCategoryName' => $item->orderItemCategoryName, 'orderItemCustomerLanguageCategoryName' => $item->orderItemCustomerLanguageCategoryName, 'orderItemBrandName' => $item->orderItemBrandName, 'orderItemCustomerLanguageBrandName' => $item->orderItemCustomerLanguageBrandName, 'orderItemQty' => $item->orderItemQty, 'orderItemDiscount' => $item->orderItemDiscount, 'orderItemPrice' => $item->orderItemPrice, 'orderItemDistributorPrice' => $item->orderItemDistributorPrice, 'orderItemTotal' => $item->orderItemTotal, 'orderItemTaxesAmount' => $item->orderItemTaxesAmount, 'orderItemTaxesRate' => $item->orderItemTaxesRate, 'orderItemCustomerCurrencyDiscount' => $item->orderItemCustomerCurrencyDiscount, 'orderItemCustomerCurrencyPrice' => $item->orderItemCustomerCurrencyPrice, 'orderItemCustomerCurrencyTotal' => $item->orderItemCustomerCurrencyTotal, 'orderItemCustomerCurrencyTaxesAmount' => $item->orderItemCustomerCurrencyTaxesAmount, 'orderItemBonusPointsSpent' => $item->orderItemBonusPointsSpent, 'shippingModuleID' => $item->shippingModuleID, 'orderItemShippingMethodCode' => $item->orderItemShippingMethodCode, 'orderItemShippingModuleName' => $item->orderItemShippingModuleName, 'orderItemCustomerLanguageShippingModuleName' => $item->orderItemCustomerLanguageShippingModuleName, 'orderItemShippingMethodName' => $item->orderItemShippingMethodName, 'orderItemCustomerLanguageShippingMethodName' => $item->orderItemCustomerLanguageShippingMethodName, 'vendorID' => $item->vendorID, 'orderItemVendorName' => $item->orderItemVendorName, 'vendorOrderID' => $item->vendorOrderID, 'vendorOrderCreateTimestamp' => $item->vendorOrderCreateTimestamp, 'orderItemOriginalProductCode' => $item->orderItemOriginalProductCode);
         }
         return $items;
     }
     if ($name == 'totalLines') {
         $totalLines = array();
         foreach ($value as $totalLine) {
             $totalLines[] = array('orderTotalLineID' => $totalLine->orderTotalLineID, 'orderID' => $totalLine->orderID, 'orderTotalLineType' => $totalLine->orderTotalLineType, 'orderTotalLineName' => $totalLine->orderTotalLineName, 'orderTotalLineCustomerLanguageName' => $totalLine->orderTotalLineCustomerLanguageName, 'orderTotalLineAmount' => $totalLine->orderTotalLineAmount, 'orderTotalLineCustomerCurrencyAmount' => $totalLine->orderTotalLineCustomerCurrencyAmount, 'orderTotalLineSort' => $totalLine->orderTotalLineSort);
         }
         return $totalLines;
     }
     return parent::convertField($name, $value);
 }
开发者ID:seliton,项目名称:seliton-php-client,代码行数:25,代码来源:Order.php

示例3: convertField

 /**
  * Convert Product custom values
  *
  * @param string $name Field name
  * @param mixed $value Field value
  * @return mixed Converted value
  */
 protected function convertField($name, $value)
 {
     if ($name == 'categories') {
         $categories = array();
         foreach ($value as $category) {
             $categories[] = array('categoryID' => $category->categoryID);
         }
         return $categories;
     }
     if ($name == 'images') {
         $images = array();
         foreach ($value as $image) {
             $images[] = array('productImageID' => $image->productImageID, 'productImage' => $image->productImage, 'productImageWidth' => $image->productImageWidth, 'productImageHeight' => $image->productImageHeight, 'productImageSize' => $image->productImageSize, 'productImageSort' => $image->productImageSort, 'productImageFeaturedStyle' => $image->productImageFeaturedStyle);
         }
         return $images;
     }
     return parent::convertField($name, $value);
 }
开发者ID:seliton,项目名称:seliton-php-client,代码行数:25,代码来源:Product.php


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