当前位置: 首页>>代码示例>>PHP>>正文


PHP History::unsetAttributes方法代码示例

本文整理汇总了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));
 }
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:30,代码来源:BansController.php

示例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));
 }
开发者ID:thongnv90,项目名称:bluesms,代码行数:13,代码来源:HistoryController.php


注:本文中的History::unsetAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。