本文整理汇总了PHP中ca_list_items::getHierarchyType方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_list_items::getHierarchyType方法的具体用法?PHP ca_list_items::getHierarchyType怎么用?PHP ca_list_items::getHierarchyType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_list_items
的用法示例。
在下文中一共展示了ca_list_items::getHierarchyType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFacetHierarchyLevel
//.........这里部分代码省略.........
$vs_pk = $t_model->primaryKey();
if ($qr_res) {
// expand facet
$va_ancestors = $t_item->getHierarchyAncestorsForIDs(array_keys($va_facet), array('returnAs' => 'ids'));
while ($qr_res->nextHit()) {
$vn_parent_id = $qr_res->get('ca_list_items.parent_id');
$vn_item_id = $qr_res->get('ca_list_items.item_id');
$vn_access = $qr_res->get('ca_list_items.access');
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;
}