本文整理汇总了PHP中Student::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::unsetAttributes方法的具体用法?PHP Student::unsetAttributes怎么用?PHP Student::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::unsetAttributes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdmin
public function actionAdmin()
{
$model = new Student('search');
$model->unsetAttributes();
if (isset($_GET['Student'])) {
$model->setAttributes($_GET['Student']);
}
$this->render('admin', array('model' => $model));
}
示例2: actionVerifyStudents
public function actionVerifyStudents()
{
$model = new Student('search');
$model->unsetAttributes();
if (isset($_GET['Student'])) {
$model->attributes = $_GET['Student'];
}
$dataProvider = $model->searchInactive();
$this->render('verifyStudents', array('model' => $model, 'dataProvider' => $dataProvider));
}
示例3: actionAdmin
public function actionAdmin()
{
$model = new Student('search');
$model->unsetAttributes();
// clear any default value
$class_id = Yii::app()->user->class_id;
$model->class_id = $class_id;
$model->is_check = 1;
$this->render('admin', array('model' => $model));
}
示例4: prepare_dataproviders
/**
* Prepares dataproviders for models and jstree open nodes.
* @return array Contains the dataproviders for the models,open nodes for the tree and the model to search for.
* @since 1.0
*/
private function prepare_dataproviders()
{
//create an array open_nodes with the ids of the nodes that we want to be initially open
//when the tree is loaded.Modify this to suit your needs.Here,we open all nodes on load.
$categories = Classroom::model()->findAll(array('order' => 'lft'));
$identifiers = array();
foreach ($categories as $n => $category) {
$identifiers[] = "'" . 'node_' . $category->id . "'";
}
$open_nodes = implode(',', $identifiers);
$cat_dataProvider = new CActiveDataProvider('Classroom');
$prod_criteria = new CDbCriteria();
$prod_criteria->with = array('assignments' => array('on' => 'assignments.id=:cat_id', 'together' => true, 'joinType' => 'INNER JOIN', 'params' => array(':cat_id' => $_GET['cat_id'])));
//for search
$model = new Student('search');
$model->unsetAttributes();
if (isset($_GET['Student'])) {
//if searching
$model->setAttributes($_GET['Student']);
$search_criteria = $model->searchCriteria();
$prod_criteria->mergeWith($search_criteria);
}
$prod_dataProvider = new CActiveDataProvider('Student', array('criteria' => $prod_criteria, 'pagination' => array('pageSize' => self::PAGING_SIZE_CAT)));
return array('cat_provider' => $cat_dataProvider, 'prod_provider' => $prod_dataProvider, 'open_nodes' => $open_nodes, 'model' => $model);
}
示例5: actionIndex
/**
* Manages all models.
*/
public function actionIndex()
{
if (!isset($_GET['cID'])) {
$this->redirect(array('classmanager/index'));
} else {
$_SESSION['cID'] = $_GET['cID'];
}
$model = new Student('search');
//$model = Student::model()->findAll('ID_Class=:idClass', array('idClass'=>$_SESSION['cID']));
$model->unsetAttributes();
// clear any default values
$model->ID_Class = $_SESSION['cID'];
if (isset($_GET['Student'])) {
$model->attributes = $_GET['Student'];
}
$this->render('admin', array('model' => $model));
}
示例6: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Student('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Student'])) {
$model->attributes = $_GET['Student'];
}
$this->render('admin', array('model' => $model));
}
示例7: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin($assignment = null)
{
$model = new Student('search');
$model->unsetAttributes();
// clear any default values
if ($assignment) {
$dataProvider = new CArrayDataProvider($this->loadStudentsFromAssignment($assignment), array('keyField' => 'id', 'pagination' => array('pageSize' => 1000)));
} else {
if (isset($_GET['Student'])) {
$model->attributes = $_GET['Student'];
}
$dataProvider = $model->search();
}
$this->render('admin', array('model' => $model, 'dataProvider' => $dataProvider));
}