コード例 #1
0
 public function testMakeDataProviderBySearchAttributeData()
 {
     $role = Role::getById(self::$roleId);
     $searchAttributeData = UsersByRoleModalListControllerUtil::makeModalSearchAttributeDataByRoleModel($role);
     $dataProvider = UsersByRoleModalListControllerUtil::makeDataProviderBySearchAttributeData($searchAttributeData);
     $this->assertTrue($dataProvider instanceof RedBeanModelDataProvider);
     $data = $dataProvider->getData();
     $this->assertEquals(1, count($data));
     $this->assertEquals($role->id, $data[0]->role->id);
 }
コード例 #2
0
ファイル: RoleController.php プロジェクト: sandeep1027/zurmo_
 public function actionUsersInRoleModalList($id)
 {
     $model = Role::getById((int) $id);
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($model);
     $searchAttributeData = UsersByRoleModalListControllerUtil::makeModalSearchAttributeDataByRoleModel($model);
     $dataProvider = UsersByRoleModalListControllerUtil::makeDataProviderBySearchAttributeData($searchAttributeData);
     Yii::app()->getClientScript()->setToAjaxMode();
     echo UsersByRoleModalListControllerUtil::renderList($this, $dataProvider);
 }