本文整理汇总了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);
}