function getCompaniesByLetter() { $companiesTable = $this->getTable("Company"); $categoryId = JRequest::getVar('categoryId'); $companies = $companiesTable->getCompaniesByLetter($this->letter, $this->enablePackages, $this->showPendingApproval, $this->getState('limitstart'), $this->getState('limit')); foreach ($companies as $company) { $company->packageFeatures = explode(",", $company->features); $attributesTable = $this->getTable('CompanyAttributes'); $company->customAttributes = $attributesTable->getCompanyAttributes($company->id); } if ($this->appSettings->enable_multilingual) { JBusinessDirectoryTranslations::updateBusinessListingsTranslation($companies); JBusinessDirectoryTranslations::updateBusinessListingsSloganTranslation($companies); } return $companies; }
function getItems() { $searchDetails = $this->getSearchParams(); $companiesTable = $this->getTable("Company"); //dump($this->getState('limitstart').' '.$this->getState('limit')); $companies = $companiesTable->getCompaniesByNameAndCategories($searchDetails, $this->getState('limitstart'), $this->getState('limit')); foreach ($companies as $company) { $company->packageFeatures = explode(",", $company->features); } foreach ($companies as $company) { $company->packageFeatures = explode(",", $company->features); $attributesTable = $this->getTable('CompanyAttributes'); $company->customAttributes = $attributesTable->getCompanyAttributes($company->id); } if ($this->appSettings->enable_multilingual) { JBusinessDirectoryTranslations::updateBusinessListingsTranslation($companies); JBusinessDirectoryTranslations::updateBusinessListingsSloganTranslation($companies); } JRequest::setVar("search-results", $companies); return $companies; }