本文整理汇总了PHP中Relation::retrieveValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Relation::retrieveValues方法的具体用法?PHP Relation::retrieveValues怎么用?PHP Relation::retrieveValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relation
的用法示例。
在下文中一共展示了Relation::retrieveValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionUpdate
public function actionUpdate()
{
$this->layout = Yum::module()->adminLayout;
$model = $this->loadModel();
$this->performAjaxValidation($model, 'yum-role-form');
if (isset($_POST['YumRole'])) {
$model->attributes = $_POST['YumRole'];
$model->users = $_POST['YumRole'];
$model->users = Relation::retrieveValues($_POST);
if ($model->validate() && $model->save()) {
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('update', array('model' => $model));
}
示例2: actionUpdate
public function actionUpdate() {
$model = $this->loadUser();
$passwordform = new YumUserChangePassword();
if(isset($_POST['YumUser'])) {
$model->attributes = $_POST['YumUser'];
if(Yum::hasModule('role')) {
Yii::import('application.modules.role.models.*');
// Assign the roles and belonging Users to the model
$model->roles = Relation::retrieveValues($_POST);
}
if(Yum::hasModule('profile')) {
$profile = $model->profile;
if(isset($_POST['YumProfile']) )
$profile->attributes = $_POST['YumProfile'];
}
// Password change is requested ?
if(isset($_POST['YumUserChangePassword'])
&& $_POST['YumUserChangePassword']['password'] != '') {
$passwordform->attributes = $_POST['YumUserChangePassword'];
if($passwordform->validate())
$model->setPassword($_POST['YumUserChangePassword']['password']);
}
if(!$passwordform->hasErrors() && $model->save()) {
if(isset($profile))
$profile->save();
$this->redirect(array('//user/user/view', 'id' => $model->id));
}
}
$this->render('update', array(
'model'=>$model,
'passwordform' =>$passwordform,
'profile' => isset($profile) ? $profile : false,
));
}