Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
UserController Class Reference
Inheritance diagram for UserController:
Controller BaseController

Public Member Functions

 filters ()
 accessRules ()
 actionView ()
 actionIndex ()
 loadModel ()
 loadUser ($id=null)

Additional Inherited Members

- Public Attributes inherited from Controller
 $menu = array()
 $breadcrumbs = array()
- Protected Member Functions inherited from BaseController
 beforeAction ($action)

Detailed Description

Definition at line 3 of file UserController.php.

Member Function Documentation

UserController::accessRules ( )

Specifies the access control rules. This method is used by the 'accessControl' filter.

Returns
array access control rules

Definition at line 24 of file UserController.php.

{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
UserController::actionIndex ( )

Lists all models.

Definition at line 51 of file UserController.php.

{
$dataProvider=new CActiveDataProvider('User', array(
'criteria'=>array(
'condition'=>'status>'.User::STATUS_BANED,
),
'pagination'=>array(
'pageSize'=>Yii::app()->controller->module->user_page_size,
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
UserController::actionView ( )

Displays a particular model.

Definition at line 40 of file UserController.php.

References loadModel().

{
$model = $this->loadModel();
$this->render('view',array(
'model'=>$model,
));
}
UserController::filters ( )
Returns
array action filters

Definition at line 13 of file UserController.php.

{
return CMap::mergeArray(parent::filters(),array(
'accessControl', // perform access control for CRUD operations
));
}
UserController::loadModel ( )

Returns the data model based on the primary key given in the GET variable. If the data model is not found, an HTTP exception will be raised.

Definition at line 72 of file UserController.php.

References User\model().

Referenced by actionView().

{
if($this->_model===null)
{
if(isset($_GET['id']))
$this->_model=User::model()->findbyPk($_GET['id']);
if($this->_model===null)
throw new CHttpException(404,'The requested page does not exist.');
}
return $this->_model;
}
UserController::loadUser (   $id = null)

Returns the data model based on the primary key given in the GET variable. If the data model is not found, an HTTP exception will be raised.

Parameters
integerthe primary key value. Defaults to null, meaning using the 'id' GET variable

Definition at line 90 of file UserController.php.

References User\model().

{
if($this->_model===null)
{
if($id!==null || isset($_GET['id']))
$this->_model=User::model()->findbyPk($id!==null ? $id : $_GET['id']);
if($this->_model===null)
throw new CHttpException(404,'The requested page does not exist.');
}
return $this->_model;
}

The documentation for this class was generated from the following file: