本文整理汇总了PHP中ca_list_items::getFieldValuesForIDs方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_list_items::getFieldValuesForIDs方法的具体用法?PHP ca_list_items::getFieldValuesForIDs怎么用?PHP ca_list_items::getFieldValuesForIDs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_list_items
的用法示例。
在下文中一共展示了ca_list_items::getFieldValuesForIDs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFacetContent
//.........这里部分代码省略.........
}
}
$vs_join_sql = join("\n", $va_joins);
if (is_array($va_wheres) && sizeof($va_wheres) && ($vs_where_sql = join(' AND ', $va_wheres))) {
$vs_where_sql = ' AND (' . $vs_where_sql . ')';
}
if ($vb_check_availability_only) {
// exclude criteria values
$vs_criteria_exclude_sql = '';
if (is_array($va_criteria) && sizeof($va_criteria)) {
$vs_criteria_exclude_sql = ' AND (ca_attribute_values.value_longtext1 NOT IN (' . join(", ", caQuoteList(array_keys($va_criteria))) . ')) ';
}
$vs_sql = "\n\t\t\t\t\t\t\tSELECT 1\n\t\t\t\t\t\t\tFROM ca_attributes\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{$vs_join_sql}\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t(ca_attribute_values.element_id = ?) {$vs_criteria_exclude_sql} {$vs_where_sql}\n\t\t\t\t\t\t\tLIMIT 2";
//print $vs_sql;
$qr_res = $this->opo_db->query($vs_sql, $vn_element_id);
return (int) $qr_res->numRows() > 1 ? true : false;
} else {
$vs_sql = "\n\t\t\t\t\t\t\tSELECT DISTINCT value_longtext1, value_decimal1, value_longtext2, value_integer1\n\t\t\t\t\t\t\tFROM ca_attributes\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{$vs_join_sql}\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tca_attribute_values.element_id = ? {$vs_where_sql}";
$qr_res = $this->opo_db->query($vs_sql, $vn_element_id);
$va_values = array();
$va_list_items = null;
$va_suppress_values = null;
if ($va_facet_info['suppress'] && !is_array($va_facet_info['suppress'])) {
$va_facet_info['suppress'] = array($va_facet_info['suppress']);
}
if (!is_array($va_suppress_values = caGetOption('suppress', $va_facet_info, null))) {
$va_suppress_values = caGetOption('exclude_values', $va_facet_info, null);
}
switch ($vn_element_type) {
case __CA_ATTRIBUTE_VALUE_LIST__:
$va_values = $qr_res->getAllFieldValues('value_longtext1');
$qr_res->seek(0);
$t_list_item = new ca_list_items();
$va_list_item_cache = $t_list_item->getFieldValuesForIDs($va_values, array('idno', 'item_value', 'parent_id', 'access'));
$va_list_child_count_cache = array();
if (is_array($va_list_item_cache)) {
foreach ($va_list_item_cache as $vn_id => $va_item) {
if (!($vn_parent_id = $va_item['parent_id'])) {
continue;
}
if (is_array($pa_options['checkAccess']) && sizeof($pa_options['checkAccess']) && !in_array($va_item['access'], $pa_options['checkAccess'])) {
continue;
}
$va_list_child_count_cache[$vn_parent_id]++;
}
}
$va_list_label_cache = $t_list_item->getPreferredDisplayLabelsForIDs($va_values);
// Translate value idnos to ids
if (is_array($va_suppress_values)) {
$va_suppress_values = ca_lists::getItemIDsFromList($t_element->get('list_id'), $va_suppress_values);
}
$va_facet_list = array();
foreach ($va_values as $vn_val) {
if (!$vn_val) {
continue;
}
if (is_array($va_suppress_values) && in_array($vn_val, $va_suppress_values)) {
continue;
}
if (is_array($pa_options['checkAccess']) && sizeof($pa_options['checkAccess']) && !in_array($va_item['access'], $pa_options['checkAccess'])) {
continue;
}
if ($va_criteria[$vn_val]) {
continue;
}
// skip items that are used as browse critera - don't want to browse on something you're already browsing on