本文整理汇总了PHP中History::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP History::unsetAttributes方法的具体用法?PHP History::unsetAttributes怎么用?PHP History::unsetAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::unsetAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionUnban
public function actionUnban($id)
{
$ban_model = $this->loadModel($id);
if (!Webadmins::checkAccess('bans_unban', $ban_model->admin_nick)) {
throw new CHttpException(403, "У Вас недостаточно прав");
}
$history_model = new History();
$history_model->unsetAttributes();
$history_model->player_ip = $ban_model->player_ip;
$history_model->player_id = $ban_model->player_id;
$history_model->player_nick = $ban_model->player_nick;
$history_model->admin_ip = $ban_model->admin_ip;
$history_model->admin_id = $ban_model->admin_id;
$history_model->admin_nick = $ban_model->admin_nick;
$history_model->ban_type = $ban_model->ban_type;
$history_model->ban_reason = $ban_model->ban_reason;
$history_model->ban_created = $ban_model->ban_created;
$history_model->ban_length = $ban_model->ban_length;
$history_model->server_ip = $ban_model->server_ip;
$history_model->server_name = $ban_model->server_name;
$history_model->unban_created = time();
$history_model->unban_reason = 'Разбанен с сайта';
$history_model->unban_admin_nick = Yii::app()->user->name;
if ($history_model->save()) {
if ($ban_model->delete()) {
Yii::app()->end('Игрок разбанен');
}
}
Yii::app()->end(CHtml::errorSummary($ban_model));
}
示例2: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new History('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['History'])) {
$model->attributes = $_GET['History'];
}
$this->render('admin', array('model' => $model));
}