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


PHP ca_objects::getMediaCountsForIDs方法代码示例

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


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

示例1: itemsWithNoDownloadableMedia

 /**
  * Checks all items in order that are downloaded and returns a list of item_ids for items
  * that have no representations attached.
  *
  * @return array A list of item_ids for which no representations are defined.
  */
 public function itemsWithNoDownloadableMedia()
 {
     if (!$this->getPrimaryKey()) {
         return null;
     }
     $o_db = $this->getDb();
     $qr_res = $o_db->query("\n\t\t\tSELECT item_id, object_id\n\t\t\tFROM ca_commerce_order_items\n\t\t\tWHERE\n\t\t\t\tfullfillment_method = 'DOWNLOAD' AND order_id = ?\n\t\t", (int) $this->getPrimaryKey());
     $va_object_ids = array();
     while ($qr_res->nextRow()) {
         $va_object_ids[$qr_res->get('object_id')] = true;
     }
     $va_object_ids = array_keys($va_object_ids);
     $qr_res->seek(0);
     $t_object = new ca_objects();
     $va_rep_counts = $t_object->getMediaCountsForIDs($va_object_ids);
     $va_items_with_no_downloadable_media = array();
     while ($qr_res->nextRow()) {
         $vn_object_id = $qr_res->get('object_id');
         if (!isset($va_rep_counts[$vn_object_id]) || !$va_rep_counts[$vn_object_id]) {
             $va_items_with_no_downloadable_media[$qr_res->get('item_id')] = true;
         }
     }
     return array_keys($va_items_with_no_downloadable_media);
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:30,代码来源:ca_commerce_orders.php


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