Ejemplo n.º 1
0
 /**
  * Get search conditions TODO refactor with XLite\Controller\Admin\ProductList::getConditions()
  *
  * @return array
  */
 protected function getConditions()
 {
     $searchParams = \XLite\Core\Session::getInstance()->{\XLite\View\ItemsList\Product\Customer\Search::getSessionCellName()};
     if (!is_array($searchParams)) {
         $searchParams = array();
     }
     return $searchParams;
 }
Ejemplo n.º 2
0
 /**
  * Define so called "request" parameters
  *
  * @return void
  */
 protected function defineRequestParams()
 {
     parent::defineRequestParams();
     $this->requestParams = array_merge($this->requestParams, \XLite\View\ItemsList\Product\Customer\Search::getSearchParams());
 }
Ejemplo n.º 3
0
 /**
  * Return params list to use for search
  * TODO refactor
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (\XLite\View\ItemsList\Product\Customer\Search::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     return $result;
 }
Ejemplo n.º 4
0
 /**
  * Return products list
  *
  * @param \XLite\Core\CommonCell $cnd       Search condition
  * @param boolean                $countOnly Return items list or only its size OPTIONAL
  *
  * @return array|integer
  */
 protected function getData(\XLite\Core\CommonCell $cnd, $countOnly = false)
 {
     return \XLite\Module\QSL\CloudSearch\Main::doSearch() && $cnd->{static::PARAM_SUBSTRING} ? \XLite\Core\Database::getRepo('\\XLite\\Model\\Product')->searchViaCloudSearch($cnd, $countOnly) : parent::getData($cnd, $countOnly);
 }