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