本文整理汇总了PHP中ca_list_items::getHierarchyList方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_list_items::getHierarchyList方法的具体用法?PHP ca_list_items::getHierarchyList怎么用?PHP ca_list_items::getHierarchyList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_list_items
的用法示例。
在下文中一共展示了ca_list_items::getHierarchyList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFacetHierarchyLevel
//.........这里部分代码省略.........
if (!in_array($vn_access, $va_access_values)) {
continue;
}
if (!in_array($vn_item_id, $va_ancestors)) {
continue;
}
$va_item = array();
$va_item['item_id'] = $vn_item_id;
$va_item['name'] = $qr_res->get('ca_list_items.preferred_labels');
$va_item['children'] = isset($va_child_counts[$vn_item_id]) && $va_child_counts[$vn_item_id] ? $va_child_counts[$vn_item_id] : 0;
$va_item['access'] = $vn_access;
$va_item['is_enabled'] = $qr_res->get('ca_list_items.is_enabled');
$va_json_data[$vn_item_id] = $va_item;
}
}
break;
}
}
break;
case 'label':
// label facet
$va_facet_info['table'] = $this->ops_tablename;
// fall through to default case
// fall through to default case
default:
if (!$vn_id && $t_item->getHierarchyType() == __CA_HIER_TYPE_SIMPLE_MONO__) {
// Force top level to be root for simple mono hierarchies
$vn_id = $t_item->getHierarchyRootID();
}
if (!$vn_id) {
$va_hier_ids = $this->opo_browse->getHierarchyIDsForFacet($ps_facet_name, array('checkAccess' => $va_access_values));
if (is_array($va_hier_ids) && sizeof($va_hier_ids) > 0 && $t_item) {
$vn_root = $t_item->getHierarchyRootID();
$va_hierarchy_list = $t_item->getHierarchyList(true);
$vn_last_id = null;
$vn_c = 0;
foreach ($va_hierarchy_list as $vn_i => $va_item) {
if (!in_array($vn_i, $va_hier_ids)) {
continue;
}
// only show hierarchies that have items in browse result
if ($vn_start <= $vn_c) {
$va_item['item_id'] = $va_item[$t_item->primaryKey()];
if (!isset($va_facet[$va_item['item_id']]) && $vn_root == $va_item['item_id']) {
continue;
}
if (isset($va_item['access']) && !in_array($va_item['access'], $va_access_values)) {
continue;
}
unset($va_item['parent_id']);
unset($va_item['label']);
$va_json_data[$va_item['item_id']] = $va_item;
$vn_last_id = $va_item['item_id'];
}
$vn_c++;
if (!is_null($vn_max_items_per_page) && $vn_c >= $vn_max_items_per_page + $vn_start) {
break;
}
}
if (sizeof($va_json_data) == 2) {
// if only one hierarchy root (root + _primaryKey in array) then don't bother showing it
$vn_id = $vn_last_id;
unset($va_json_data[$vn_last_id]);
}
}
}