public function getMetadataFilteredByOption($option) { if ($option == null) { $option = MissionsListConfigurationForm::LIST_TYPE_AVAILABLE; } $mission = new Mission(false); $metadataAdapter = new MissionsSearchDataProviderMetadataAdapter($mission, Yii::app()->user->userModel->id, array(), $option); return $metadataAdapter->getAdaptedMetadata(); }
/** * @param Mission $mission * @param int $type * @param int $pageSize * @return RedBeanModelDataProvider' */ public static function makeDataProviderByType(Mission $mission, $type, $pageSize) { if ($type == null) { $type = MissionsListConfigurationForm::LIST_TYPE_AVAILABLE; } $searchAttributes = array(); $metadataAdapter = new MissionsSearchDataProviderMetadataAdapter($mission, Yii::app()->user->userModel->id, $searchAttributes, $type); $dataProvider = RedBeanModelDataProviderUtil::makeDataProvider($metadataAdapter->getAdaptedMetadata(), 'Mission', 'RedBeanModelDataProvider', 'latestDateTime', true, $pageSize); return $dataProvider; }