本文整理汇总了PHP中JFactory::getBO方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::getBO方法的具体用法?PHP JFactory::getBO怎么用?PHP JFactory::getBO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFactory
的用法示例。
在下文中一共展示了JFactory::getBO方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cacheProductsFeatures
public static function cacheProductsFeatures($product_ids)
{
if (!JeproshopFeatureModelFeature::isFeaturePublished()) {
return;
}
$product_implode = array();
foreach ($product_ids as $product_id) {
if ((int) $product_id && !array_key_exists($product_id, self::$_cacheFeatures)) {
$product_implode[] = (int) $product_id;
}
}
if (!count($product_implode)) {
return;
}
$db = JFactory::getBO();
$query = "SELECT feature_id, product_id, feature_value_id FROM " . $db->quoteName('#__jeproshop_feature_product') . " WHERE ";
$query .= $db->quoteName('product_id') . " IN (" . implode($product_implode, ',') . ")";
$db->setQuery($query);
$result = $db->loadObjectList();
foreach ($result as $row) {
if (!array_key_exists($row->product_id, self::$_cacheFeatures)) {
self::$_cacheFeatures[$row->product_id] = array();
}
self::$_cacheFeatures[$row->product_id][] = $row;
}
}