getListForIndexPage() public method

public getListForIndexPage ( ) : CActiveDataProvider
return CActiveDataProvider
Beispiel #1
0
 /**
  *
  */
 public function actionIndex()
 {
     $typesSearchParam = $this->attributeFilter->getTypeAttributesForSearchFromQuery(Yii::app()->getRequest());
     $mainSearchParam = $this->attributeFilter->getMainAttributesForSearchFromQuery(Yii::app()->getRequest(), [AttributeFilter::MAIN_SEARCH_PARAM_NAME => Yii::app()->getRequest()->getQuery(AttributeFilter::MAIN_SEARCH_QUERY_NAME)]);
     if (!empty($mainSearchParam) || !empty($typesSearchParam)) {
         $data = $this->productRepository->getByFilter($mainSearchParam, $typesSearchParam);
     } else {
         $data = $this->productRepository->getListForIndexPage();
     }
     $this->render('index', ['dataProvider' => $data]);
 }