function getSearchParameters() { $categoryService = new JBusinessDirectorCategoryLib(); $categoriesIds = null; if (!empty($this->categoryId)) { $categoriesIds = $categoryService->getCategoryLeafs($this->categoryId); if (count($categoriesIds) == 0 && isset($this->categoryId)) { $categoriesIds = array($this->categoryId); } else { $categoriesIds[] = $this->categoryId; } } $searchDetails = array(); $searchDetails["keyword"] = $this->keyword; $searchDetails["categoriesIds"] = $categoriesIds; if (!empty($this->location)) { $searchDetails["latitude"] = $this->location["latitude"]; $searchDetails["longitude"] = $this->location["longitude"]; } $searchDetails["radius"] = $this->radius; $searchDetails["citySearch"] = $this->citySearch; $searchDetails["regionSearch"] = $this->regionSearch; $searchDetails["enablePackages"] = $this->enablePackages; $searchDetails["showPendingApproval"] = $this->showPendingApproval; $searchDetails["orderBy"] = $this->orderBy; return $searchDetails; }
function getSearchParameters() { $categoryService = new JBusinessDirectorCategoryLib(); $categoriesIds = null; if (!empty($this->categoryId)) { $categoriesIds = $categoryService->getCategoryLeafs($this->categoryId); if (count($categoriesIds) == 0 && isset($this->categoryId)) { $categoriesIds = array($this->categoryId); } else { $categoriesIds[] = $this->categoryId; } } //dump($categoriesIds); $searchDetails = array(); $searchDetails["keyword"] = $this->keyword; $searchDetails["categoriesIds"] = $categoriesIds; $searchDetails["startDate"] = JBusinessUtil::convertToMysqlFormat($this->startDate); $searchDetails["endDate"] = JBusinessUtil::convertToMysqlFormat($this->endDate); $searchDetails["typeSearch"] = $this->typeSearch; $searchDetails["enablePackages"] = $this->enablePackages; $searchDetails["showPendingApproval"] = $this->showPendingApproval; return $searchDetails; }
function getSearchParams() { $categories = $this->getSelectedCategories(); //dump($categories); $filterActive = JRequest::getVar("filter_active"); $categoryService = new JBusinessDirectorCategoryLib(); $categoriesIds = array(); if (isset($categories) && count($categories) > 0) { foreach ($categories as $category) { $categoriesLevel = array(); $cats = $categoryService->getCategoryLeafs($category); //dump($category); //dump($cats); if (isset($cats)) { $categoriesLevel = array_merge($categoriesLevel, $cats); } $categoriesLevel[] = $category; $categoriesIds[] = implode(",", $categoriesLevel); } } else { if (isset($this->categoryId) && $this->categoryId != 0 && empty($filterActive)) { $categoriesIds = $categoryService->getCategoryLeafs($this->categoryId); if (isset($this->categoryId) && $this->categoryId != 0) { if (isset($categoriesIds) && count($categoriesIds) > 0) { $categoriesIds[] = $this->categoryId; } else { $categoriesIds = array($this->categoryId); } } $categoriesIds = array(implode(",", $categoriesIds)); } } $orderBy = JRequest::getVar("orderBy", "packageOrder desc"); $searchDetails = array(); $searchDetails["keyword"] = $this->keyword; $searchDetails["keywordLocation"] = $this->keywordLocation; $searchDetails["categoriesIds"] = $categoriesIds; if (!empty($this->location)) { $searchDetails["latitude"] = $this->location["latitude"]; $searchDetails["longitude"] = $this->location["longitude"]; } $searchDetails["radius"] = $this->radius; $searchDetails["typeSearch"] = $this->typeSearch; $searchDetails["citySearch"] = $this->citySearch; $searchDetails["regionSearch"] = $this->regionSearch; $searchDetails["countrySearch"] = $this->countrySearch; $searchDetails["enablePackages"] = $this->enablePackages; $searchDetails["showPendingApproval"] = $this->showPendingApproval; $searchDetails["orderBy"] = $orderBy; $searchDetails["facetedSearch"] = $this->appSettings->search_type; $searchDetails["zipcCodeSearch"] = $this->appSettings->zipcode_search_type; $searchDetails["limit_cities"] = $this->appSettings->limit_cities; $searchDetails["customAttributes"] = $this->customAtrributes; $searchDetails["featured"] = $this->featured; return $searchDetails; }