本文整理汇总了PHP中FlexicontentFields::getFilterValuesSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP FlexicontentFields::getFilterValuesSearch方法的具体用法?PHP FlexicontentFields::getFilterValuesSearch怎么用?PHP FlexicontentFields::getFilterValuesSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlexicontentFields
的用法示例。
在下文中一共展示了FlexicontentFields::getFilterValuesSearch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createFilterValuesSearch
static function createFilterValuesSearch($filter, $view_join, $view_where, $filters_where, $indexed_elements, $search_prop)
{
$faceted_filter = $filter->parameters->get('faceted_filter_s', 2);
$display_filter_as = $filter->parameters->get('display_filter_as_s', 0);
// Filter Type of Display
$filter_as_range = in_array($display_filter_as, array(2, 3));
$lang_filter_values = $filter->parameters->get('lang_filter_values', 1);
//$show_matching_items = $filter->parameters->get( 'show_matching_items_s', 1 );
//$show_matches = $filter_as_range || !$faceted_filter ? 0 : $show_matching_items;
$filter->filter_isindexed = (bool) $indexed_elements;
$_results = FlexicontentFields::getFilterValuesSearch($filter, $view_join, $view_where, $filters_where);
$results =& $_results;
// Language filter labels
if ($lang_filter_values) {
foreach ($results as $i => $result) {
$results[$i]->text = JText::_($result->text);
}
}
// Skip sorting for indexed elements, DB query or element entry is responsible
// for ordering indexable fields, also skip if ordering is done by the filter
if (!$indexed_elements && empty($filter->filter_orderby)) {
uksort($results, 'strnatcasecmp');
}
return $results;
}
示例2: createFilterValuesSearch
static function createFilterValuesSearch($filter, $view_join, $view_where, $filters_where, $indexed_elements, $search_prop)
{
$faceted_filter = $filter->parameters->get('faceted_filter_s', 2);
$display_filter_as = $filter->parameters->get('display_filter_as_s', 0);
// Filter Type of Display
$isRange = in_array($display_filter_as, array(2, 3, 8));
$lang_filter_values = $filter->parameters->get('lang_filter_values', 1);
$show_matching_items = $filter->parameters->get('show_matching_items_s', 1);
$show_matches = $isRange || !$faceted_filter ? 0 : $show_matching_items;
$filter->filter_isindexed = (bool) $indexed_elements;
if ($faceted_filter || !$indexed_elements) {
$_results = FlexicontentFields::getFilterValuesSearch($filter, $view_join, $view_where, $filters_where);
//echo "<pre>". $filter->label.": ". print_r($_results, true) ."\n\n</pre>";
}
// Support of value-indexed fields
if (!$faceted_filter && $indexed_elements) {
// Clone 'indexed_elements' because they maybe modified
$results = array();
foreach ($indexed_elements as $i => $result) {
$results[$i] = clone $result;
}
} else {
if ($indexed_elements && is_array($indexed_elements)) {
// Limit indexed element according to DB results found
$results = array_intersect_key($indexed_elements, $_results);
//echo "<pre>". $filter->label.": ". print_r($indexed_elements, true) ."\n\n</pre>";
if ($faceted_filter == 2 && $show_matches) {
foreach ($results as $i => $result) {
$result->found = $_results[$i]->found;
// Clone 'indexed_elements' because they maybe modified
$results[$i] = clone $result;
}
}
} else {
$results =& $_results;
}
}
// Language filter values/labels (for indexed fields this is already done)
if ($lang_filter_values && !$indexed_elements) {
foreach ($results as $i => $result) {
$results[$i]->text = JText::_($result->text);
}
}
// Skip sorting for indexed elements, DB query or element entry is responsible
// for ordering indexable fields, also skip if ordering is done by the filter
if (!$indexed_elements && empty($filter->filter_orderby_adv)) {
uksort($results, 'strnatcasecmp');
if ($filter->parameters->get('reverse_filter_order', 0)) {
$results = array_reverse($results, true);
}
}
return $results;
}