Esempio n. 1
0
 protected function makeDataProviderBySearchAttributeData($searchAttributeData)
 {
     assert('is_array($searchAttributeData)');
     list($sortAttribute, $sortDescending) = SearchUtil::resolveSortFromStickyData($this->modelClassName, $this->uniqueLayoutId);
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('dashboardListPageSize');
     $redBeanModelDataProvider = new RedBeanModelDataProvider($this->modelClassName, $sortAttribute, $sortDescending, $searchAttributeData, array('pagination' => array('pageSize' => $pageSize)));
     $sort = new RedBeanSort($redBeanModelDataProvider->modelClassName);
     $sort->sortVar = $redBeanModelDataProvider->getId() . '_sort';
     $sort->route = 'default/index';
     $redBeanModelDataProvider->setSort($sort);
     return $redBeanModelDataProvider;
 }
Esempio n. 2
0
 protected function makeDataProviderBySearchAttributeData($searchAttributeData)
 {
     assert('is_array($searchAttributeData)');
     list($sortAttribute, $sortDescending) = SearchUtil::resolveSortFromStickyData($this->modelClassName, $this->uniqueLayoutId);
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('dashboardListPageSize');
     if ($sortAttribute === null) {
         $sortAttribute = $this->getSortAttributeForDataProvider();
         $sortDescending = $this->resolveSortDescendingForDataProvider();
     }
     $redBeanModelDataProvider = new RedBeanModelDataProvider($this->modelClassName, $sortAttribute, $sortDescending, $searchAttributeData, array('pagination' => array('pageSize' => $pageSize)));
     $sort = new RedBeanSort($redBeanModelDataProvider->modelClassName);
     $sort->sortVar = $redBeanModelDataProvider->getId() . '_sort';
     $sort->route = 'defaultPortlet/myListDetails';
     $sort->params = array_merge(GetUtil::getData(), array('portletId' => $this->params['portletId']));
     $redBeanModelDataProvider->setSort($sort);
     return $redBeanModelDataProvider;
 }