本文整理汇总了PHP中BFCHelper::getFilterSearchParamsSession方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::getFilterSearchParamsSession方法的具体用法?PHP BFCHelper::getFilterSearchParamsSession怎么用?PHP BFCHelper::getFilterSearchParamsSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::getFilterSearchParamsSession方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = NULL, $preparecontent = false)
{
$document = JFactory::getDocument();
$language = $document->getLanguage();
$config = JComponentHelper::getParams('com_bookingforconnector');
$app = JFactory::getApplication();
// Initialise variables
$state = $this->get('State');
$items = $this->get('Items');
$pagination = $this->get('Pagination');
$sortColumn = $state->get('list.ordering');
$sortDirection = $state->get('list.direction');
$params = $state->params;
$typologies = $this->getModel()->getMasterTypologies(true, $language);
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
$pagination->setAdditionalUrlParam("filter_order", $sortColumn);
$pagination->setAdditionalUrlParam("filter_order_Dir", $sortDirection);
$pagination->setAdditionalUrlParam("searchid", $params['searchid']);
$filters = BFCHelper::getFilterSearchParamsSession();
if (!empty($filters)) {
foreach ($filters as $key => $value) {
$pagination->setAdditionalUrlParam("filters[" . $key . "]", $value);
}
}
$hidesort = false;
$this->assignRef('state', $state);
$this->assignRef('params', $params);
$this->assignRef('items', $items);
$this->assignRef('pagination', $pagination);
$this->assignRef('language', $language);
$this->assignRef('typologies', $typologies);
$this->assignRef('config', $config);
$this->assignRef('hidesort', $hidesort);
$maxItemsView = 3;
$this->assignRef('maxItemsView', $maxItemsView);
$analyticsEnabled = $this->checkAnalytics("");
$this->assignRef('analyticsEnabled', $analyticsEnabled);
// Display the view
parent::display($tpl, true);
}
示例2: explode
// $filtersEnabledRateplanName = explode(",", $filtersEnabled['rateplanname']);
$filtersEnabledRateplanName = $filtersEnabled['rateplanname'];
}
}
$filtersPriceMin = $priceScaleMin;
$filtersPriceMax = $priceScaleMax;
if ($filtersPriceMin == $filtersPriceMax) {
$filtersPriceMax += 1;
}
if ($filtersPriceMax - $filtersPriceMin < $priceScaleStep) {
$priceScaleStep = $filtersPriceMax - $filtersPriceMin;
}
if ($priceScaleStep < $priceScaleMax) {
$priceScaleStep = 1;
}
$filters = BFCHelper::getFilterSearchParamsSession();
$filtersStarsValue = "";
$filtersLocationZonesValue = "";
$filtersMerchantGroupsValue = "";
$filtersServicesValue = "";
$filtersServicesMerchantsValue = "";
$filtersMasterTypologiesValue = "";
$filtersBookingTypesValue = "";
$filtersOffersValue = "";
$filtersRateplanNameValue = "";
$filtersRoomsValue = "";
if (isset($filters)) {
if (!empty($filters['stars'])) {
$filtersStars = explode(",", $filters['stars']);
$filtersStarsValue = $filters['stars'];
}
示例3: filterResults
private function filterResults($results)
{
$params = $this->getState('params');
$filters = null;
if (!empty($params['filters'])) {
$filters = $params['filters'];
}
if ($filters == null) {
//provo a recuperarli dalla sessione...
$filters = BFCHelper::getFilterSearchParamsSession();
}
if ($filters == null) {
return $results;
}
BFCHelper::setFilterSearchParamsSession($filters);
// zone filtering
if (!empty($filters['locationzones']) && is_array($results)) {
$locationzones = $filters['locationzones'];
$locationzones = explode(",", $locationzones);
if (is_array($locationzones) || $locationzones != "0") {
$results = array_filter($results, function ($result) use($locationzones) {
return is_array($locationzones) && (in_array($result->MrcZoneId, $locationzones) || in_array($result->ResZoneId, $locationzones)) || ($result->MrcZoneId == $locationzones || $result->ResZoneId == $locationzones);
});
}
}
// merchantgroups filtering
if (!empty($filters['merchantgroups']) && is_array($results)) {
$merchantgroups = $filters['merchantgroups'];
$merchantgroups = explode(",", $merchantgroups);
if (is_array($merchantgroups)) {
//if ($stars > 0) {
$results = array_filter($results, function ($result) use($merchantgroups) {
$hasTags = false;
$val = preg_replace('/\\s+/', '', $result->MrcTagsIdList);
$merchantGroupIdList = explode(",", $val);
if (is_array($merchantGroupIdList)) {
$arrayresult = array_intersect($merchantgroups, $merchantGroupIdList);
$hasTags = count($arrayresult) > 0;
} else {
$hasTags = is_array($merchantgroups) && in_array($merchantGroupIdList, $merchantgroups) || $merchantGroupIdList == $merchantgroups;
}
$val = preg_replace('/\\s+/', '', $result->TagsIdList);
$merchantGroupIdList = explode(",", $val);
if (is_array($merchantGroupIdList)) {
$arrayresult = array_intersect($merchantgroups, $merchantGroupIdList);
$hasTags = $hasTags || count($arrayresult) > 0;
} else {
$hasTags = $hasTags || (is_array($merchantgroups) && in_array($merchantGroupIdList, $merchantgroups) || $merchantGroupIdList == $merchantgroups);
}
return $hasTags;
});
}
}
// // services filtering
// if (!empty($filters['services']) && is_array($results)) {
// $services = $filters['services'];
// $services = explode(",", $services);
// if (is_array($services)){
// $results = array_filter($results, function($result) use ($services) {
// $merchantServiceIdList = explode(",",$result->MrcServiceIdList);
// $resourceServiceIdList = explode(",",$result->ResServiceIdList);
// $serviceIdList = array_merge($merchantServiceIdList,$resourceServiceIdList);
// if (is_array($serviceIdList)) {
// $arrayresult = array_intersect($services, $serviceIdList);
// return (count($arrayresult)==count($services));
//
// }else{
// return ((is_array($services) && in_array( $serviceIdList, $services )) || $serviceIdList == $services );
// }
// });
// }
// }
// services filtering resource
if (!empty($filters['services']) && is_array($results)) {
$services = $filters['services'];
$services = explode(",", $services);
if (is_array($services)) {
$results = array_filter($results, function ($result) use($services) {
$serviceIdList = explode(",", $result->ResServiceIdList);
if (is_array($serviceIdList)) {
$arrayresult = array_intersect($services, $serviceIdList);
return count($arrayresult) == count($services);
} else {
return is_array($services) && in_array($serviceIdList, $services) || $serviceIdList == $services;
}
});
}
}
// services filtering merchants
if (!empty($filters['servicesmerchants']) && is_array($results)) {
$services = $filters['servicesmerchants'];
$services = explode(",", $services);
if (is_array($services)) {
$results = array_filter($results, function ($result) use($services) {
$serviceIdList = explode(",", $result->MrcServiceIdList);
if (is_array($serviceIdList)) {
$arrayresult = array_intersect($services, $serviceIdList);
return count($arrayresult) == count($services);
} else {
return is_array($services) && in_array($serviceIdList, $services) || $serviceIdList == $services;
//.........这里部分代码省略.........
示例4: filterResults
private function filterResults($results)
{
$params = $this->getState('params');
$filters = null;
if (!empty($params['filters'])) {
$filters = $params['filters'];
}
if ($filters == null) {
//provo a recuperarli dalla sessione...
$filters = BFCHelper::getFilterSearchParamsSession();
}
if ($filters == null) {
return $results;
}
BFCHelper::setFilterSearchParamsSession($filters);
// zone filtering
if (!empty($filters['locationzones']) && is_array($results)) {
$locationzones = $filters['locationzones'];
$locationzones = explode(",", $locationzones);
if (is_array($locationzones) || $locationzones != "0") {
$results = array_filter($results, function ($result) use($locationzones) {
return is_array($locationzones) && (in_array($result->MrcZoneId, $locationzones) || in_array($result->ResZoneId, $locationzones)) || ($result->MrcZoneId == $locationzones || $result->ResZoneId == $locationzones);
});
}
}
// merchantgroups filtering
if (!empty($filters['merchantgroups']) && is_array($results)) {
$merchantgroups = $filters['merchantgroups'];
// echo "<pre>";
// echo print_r($mastertypologies);
// echo "</pre>";
$merchantgroups = explode(",", $merchantgroups);
if (is_array($merchantgroups)) {
//if ($stars > 0) {
$results = array_filter($results, function ($result) use($merchantgroups) {
$val = preg_replace('/\\s+/', '', $result->MrcGroupIdList);
$merchantGroupIdList = explode(",", $val);
if (is_array($merchantGroupIdList)) {
$arrayresult = array_intersect($merchantgroups, $merchantGroupIdList);
return count($arrayresult) > 0;
} else {
return is_array($merchantgroups) && in_array($merchantGroupIdList, $merchantgroups) || $merchantGroupIdList == $merchantgroups;
}
});
}
}
// services filtering
if (!empty($filters['services']) && is_array($results)) {
$services = $filters['services'];
// echo "<pre>";
// echo print_r($services);
// echo "</pre>";
$services = explode(",", $services);
if (is_array($services)) {
$results = array_filter($results, function ($result) use($services) {
$merchantServiceIdList = explode(",", $result->MrcServiceIdList);
$resourceServiceIdList = explode(",", $result->ResServiceIdList);
$serviceIdList = array_merge($merchantServiceIdList, $resourceServiceIdList);
if (is_array($serviceIdList)) {
$arrayresult = array_intersect($services, $serviceIdList);
//return (count($arrayresult)>0);
//21/11/2014
/// modifica per ritornare solo quelli che hanno TUTTI i servizi selezionati
return count($arrayresult) == count($services);
} else {
return is_array($services) && in_array($serviceIdList, $services) || $serviceIdList == $services;
}
});
}
}
// mastertypologies filtering
if (!empty($filters['mastertypologies']) && is_array($results)) {
$mastertypologies = $filters['mastertypologies'];
$mastertypologies = explode(",", $mastertypologies);
if (is_array($mastertypologies)) {
//if ($stars > 0) {
$results = array_filter($results, function ($result) use($mastertypologies) {
return is_array($mastertypologies) && in_array($result->MasterTypologyId, $mastertypologies) || $result->MasterTypologyId == $mastertypologies;
});
}
}
// stars filtering
if (!empty($filters['stars']) && is_array($results)) {
$stars = $filters['stars'];
$stars = explode(",", $stars);
if (is_array($stars) || $stars != "0") {
$results = array_filter($results, function ($result) use($stars) {
return is_array($stars) && (in_array($result->MrcRating, $stars) || $result->MrcRating == $stars || in_array($result->ResRating, $stars)) || $result->ResRating == $stars;
});
}
}
// bookingTypes filtering
if (!empty($filters['bookingtypes']) && is_array($results)) {
$bookingTypes = $filters['bookingtypes'];
$stars = explode(",", $bookingTypes);
if (is_array($bookingTypes) || $bookingTypes != "0") {
$results = array_filter($results, function ($result) use($bookingTypes) {
return is_array($bookingTypes) && in_array($result->BookingType, $bookingTypes) || $result->BookingType == $bookingTypes;
});
}
//.........这里部分代码省略.........