本文整理汇总了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));
}
示例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);
}