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


PHP OrderItem::setSKU方法代码示例

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


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

示例1: getItems

 /**
  * @return OrderItem[] $items
  */
 public function getItems()
 {
     APIWrapper::verifyReadiness();
     $requestURL = "https://app.fetchapp.com/api/v2/orders/" . $this->OrderID . "/order_items";
     $results = APIWrapper::makeRequest($requestURL, "GET");
     $items = array();
     foreach ($results->order_item as $item) {
         $i = new OrderItem();
         $i->setItemID((string) $item->id);
         $i->setSKU((string) $item->sku);
         $i->setOrderID((string) $item->order_id);
         $i->setProductName((string) $item->product_name);
         $i->setPrice((double) $item->price);
         $i->setDownloadCount((int) $item->download_count);
         if (!isset($item->custom_1['nil'])) {
             $i->setCustom1($item->custom_1);
         } else {
             $i->setCustom1(null);
         }
         if (!isset($item->custom_2['nil'])) {
             $i->setCustom2($item->custom_2);
         } else {
             $i->setCustom2(null);
         }
         if (!isset($item->custom_3['nil'])) {
             $i->setCustom3($item->custom_3);
         } else {
             $i->setCustom3(null);
         }
         if (!isset($item->license_key['nil'])) {
             $i->setLicenseKey((string) $item->license_key);
         } else {
             $i->setLicenseKey(null);
         }
         $i->setCreationDate(new \DateTime($item->created_at));
         // $i->setDownloadsRemaining(0); // We don't seem to be getting this back.
         $items[] = $i;
     }
     return $items;
 }
开发者ID:themgt,项目名称:fetchapp-php-2.0,代码行数:43,代码来源:Order.php


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