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


PHP Quota::save方法代码示例

本文整理汇总了PHP中Quota::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Quota::save方法的具体用法?PHP Quota::save怎么用?PHP Quota::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Quota的用法示例。


在下文中一共展示了Quota::save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Quota();
     if (isset($_POST['Quota'])) {
         $model->attributes = $_POST['Quota'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->idQuota));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:upmunspel,项目名称:abiturient,代码行数:15,代码来源:QuotaController.php

示例2: insertquota

 function insertquota($iSurveyId)
 {
     $iSurveyId = sanitize_int($iSurveyId);
     $this->_checkPermissions($iSurveyId, 'create');
     $aData = $this->_getData($iSurveyId);
     $aLangs = $aData['aLangs'];
     $oQuota = new Quota();
     $oQuota->sid = $iSurveyId;
     $oQuota->name = Yii::app()->request->getPost('quota_name');
     $oQuota->qlimit = Yii::app()->request->getPost('quota_limit');
     $oQuota->action = Yii::app()->request->getPost('quota_action');
     $oQuota->autoload_url = Yii::app()->request->getPost('autoload_url');
     $oQuota->save();
     $iQuotaId = $oQuota->id;
     //Iterate through each language, and make sure there is a quota message for it
     $sError = '';
     foreach ($aLangs as $sLang) {
         if (!$_POST['quotals_message_' . $sLang]) {
             $sError .= getLanguageNameFromCode($sLang, false) . "\\n";
         }
     }
     if ($sError != '') {
         $aData['sShowError'] = $sError;
     } else {
         foreach ($aLangs as $sLang) {
             //Clean XSS - Automatically provided by CI input class
             $_POST['quotals_message_' . $sLang] = html_entity_decode($_POST['quotals_message_' . $sLang], ENT_QUOTES, "UTF-8");
             // Fix bug with FCKEditor saving strange BR types
             $_POST['quotals_message_' . $sLang] = fixCKeditorText($_POST['quotals_message_' . $sLang]);
             $oQuotaLanguageSettings = new QuotaLanguageSetting();
             $oQuotaLanguageSettings->quotals_quota_id = $iQuotaId;
             $oQuotaLanguageSettings->quotals_language = $sLang;
             $oQuotaLanguageSettings->quotals_name = Yii::app()->request->getPost('quota_name');
             $oQuotaLanguageSettings->quotals_message = $_POST['quotals_message_' . $sLang];
             $oQuotaLanguageSettings->quotals_url = $_POST['quotals_url_' . $sLang];
             $oQuotaLanguageSettings->quotals_urldescrip = $_POST['quotals_urldescrip_' . $sLang];
             $oQuotaLanguageSettings->save();
         }
     }
     self::_redirectToIndex($iSurveyId);
 }
开发者ID:joaocc,项目名称:LimeSurvey--LimeSurvey,代码行数:41,代码来源:quotas.php


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