當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CActiveRecord::afterValidate方法代碼示例

本文整理匯總了PHP中CActiveRecord::afterValidate方法的典型用法代碼示例。如果您正苦於以下問題:PHP CActiveRecord::afterValidate方法的具體用法?PHP CActiveRecord::afterValidate怎麽用?PHP CActiveRecord::afterValidate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CActiveRecord的用法示例。


在下文中一共展示了CActiveRecord::afterValidate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterValidate

 protected function afterValidate()
 {
     if (!$this->getDateRegMatch()) {
         $this->addError('datum', 'Datum muss das Format: TT.MM.JJJJ oder TT-TT.MM.JJJJ oder TT/TT.MM.JJJJ oder TT.MM.JJJJ-TT.MM.JJJJ haben.');
     }
     return parent::afterValidate();
 }
開發者ID:balrok,項目名稱:aiajaya,代碼行數:7,代碼來源:Termin.php

示例2: afterValidate

 protected function afterValidate()
 {
     if ($this->isNewRecord || $this->newPassword) {
         $this->password = $this->encrypt($this->password);
     }
     return parent::afterValidate();
 }
開發者ID:rinatio,項目名稱:YiiBackbone,代碼行數:7,代碼來源:User.php

示例3: afterValidate

 protected function afterValidate()
 {
     $highlighter = new CTextHighlighter();
     $highlighter->language = $this->language;
     $this->html = $highlighter->highlight($this->code);
     return parent::afterValidate();
 }
開發者ID:moohwaan,項目名稱:yii-application-cookbook-2nd-edition-code,代碼行數:7,代碼來源:Snippet.php

示例4: afterValidate

 protected function afterValidate()
 {
     parent::afterValidate();
     if (!$this->hasErrors()) {
         $this->password = $this->hashPassword($this->password);
     }
 }
開發者ID:AlifArnado,項目名稱:project_penjulan-using-yii,代碼行數:7,代碼來源:User.php

示例5: afterValidate

 public function afterValidate()
 {
     $this->onBeforeSave = function ($event) {
         $finfo = finfo_open(FILEINFO_MIME_TYPE);
         $event->sender->mime_type = finfo_file($finfo, 'files/_user/bloc_document/' . $event->sender->file);
         finfo_close($finfo);
     };
     return parent::afterValidate();
 }
開發者ID:kostya1017,項目名稱:our,代碼行數:9,代碼來源:BlocDocumentDocument.php

示例6: afterValidate

 protected function afterValidate()
 {
     foreach (array_keys(Yii::app()->params["ac_areas_chap"]) as $ac) {
         if ($this->{$ac} == "") {
             $this->{$ac} = null;
         }
     }
     // Если нам указали особые права доступа, проверяем, есть ли уже такие в переводе?
     if ($this->ac_read . $this->ac_gen . $this->ac_rate . $this->ac_comment . $this->ac_tr != "") {
         $r = Yii::app()->db->createCommand("SELECT 1 FROM chapters WHERE book_id = :book_id AND id != :id AND (ac_read || ac_gen || ac_rate || ac_comment || ac_tr != '')")->query(array("book_id" => $this->book_id, "id" => $this->id));
         if ($r->rowCount > 0) {
             $this->addError("ac_read", "В переводе только одна глава может иметь особые права доступа.");
         }
     }
     parent::afterValidate();
 }
開發者ID:norayr,項目名稱:notabenoid,代碼行數:16,代碼來源:Chapter.php

示例7: afterValidate

 protected function afterValidate()
 {
     // Аватар
     if ($this->scenario == "info" && $this->rm_img) {
         $this->img->delete();
     }
     if ($this->scenario == "info" && $this->new_img) {
         $new_img = new UploadedImage("book");
         if (!$new_img->upload($this->new_img, 200, 500)) {
             $this->addError("new_img", "Не удалось загрузить картинку, попробуйте другую.");
             return;
         }
         if ($this->img instanceof UploadedImage) {
             $this->img->delete();
         }
         $this->img = $new_img;
     }
     parent::afterValidate();
 }
開發者ID:norayr,項目名稱:notabenoid,代碼行數:19,代碼來源:Book.php

示例8: afterValidate

 protected function afterValidate()
 {
     if ($this->hasErrors()) {
         $this->instrumento_juridico = InstrumentoJuridico::load(json_decode($this->instrumento_juridico));
         $this->convenio = Convenio::load(json_decode($this->convenio));
     }
     parent::afterValidate();
 }
開發者ID:elikristina,項目名稱:portalcegov,代碼行數:8,代碼來源:Projeto.php

示例9: afterValidate

 protected function afterValidate()
 {
     if ($this->scenario == 'buy') {
         return true;
     }
     if (!$this->access) {
         $this->addError('access', 'Выберите флаги доступа');
     }
     if ($this->isNewRecord && $this->flags === 'a' && !$this->password) {
         $this->addError('password', 'Для админки по нику нужно обязательно указывать пароль');
     }
     if ($this->flags === 'd' && !filter_var($this->steamid, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4))) {
         $this->addError('steamid', 'Неверно введен IP');
     }
     if ($this->flags === 'c' && !Prefs::validate_value($this->steamid, 'steamid')) {
         $this->addError('steamid', 'Неверно введен SteamID');
     }
     if ($this->password && !preg_match('#^([a-z0-9]+)$#i', $this->password)) {
         $this->addError('password', 'Пароль может содержать только буквы латинского алфавита и цифры');
     }
     if (!$this->isNewRecord && $this->days < $this->change && $this->addtake === '1') {
         $this->addError('', 'Ошибка! Нельзя забрать дней больше, чем у него уже есть');
     }
     if (empty($this->servers)) {
         $this->addError('servers', 'Выберите хотябы один сервер');
     }
     if ($this->hasErrors()) {
         return $this->getErrors();
     }
     return parent::afterValidate();
 }
開發者ID:BroneKot,項目名稱:CS-Bans,代碼行數:31,代碼來源:Amxadmins.php

示例10: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     if (isset($this->cert_image) && $this->cert_image != null) {
     }
 }
開發者ID:aakbar24,項目名稱:CollegeCorner_Ver_2.0,代碼行數:6,代碼來源:Certification.php

示例11: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     $this->dbDate();
 }
開發者ID:fobihz,項目名稱:cndiesel,代碼行數:5,代碼來源:Faq.php

示例12: afterValidate

 protected function afterValidate()
 {
     parent::afterValidate();
     //$this->password = $this->encrypt($this->password,Yii::app()->params->hashkey);
     $this->ip = $_SERVER['REMOTE_ADDR'];
 }
開發者ID:nguyendvphp,項目名稱:zicza,代碼行數:6,代碼來源:SystemUser.php

示例13: afterValidate

 /**
  * apply a hash on the password before we store it in the database
  */
 protected function afterValidate()
 {
     parent::afterValidate();
     //ensure we don't have any other errors
     if (!$this->hasErrors()) {
         $this->password = $this->hashPassword($this->password);
     }
 }
開發者ID:dimahongkong,項目名稱:Searching-Exploring-with-Speech-Augmented-Map-Information-SESAMI,代碼行數:11,代碼來源:Account.php

示例14: afterValidate

 protected function afterValidate()
 {
     parent::afterValidate();
     //lakukan enkripsi pada password yang di input
 }
開發者ID:jumper2012,項目名稱:english_learning,代碼行數:5,代碼來源:User.php

示例15: afterValidate

 protected function afterValidate()
 {
     parent::afterValidate();
     $this->pwd_hash = $this->hash($this->password);
 }
開發者ID:stpncpe,項目名稱:cbdbx,代碼行數:5,代碼來源:User.php


注:本文中的CActiveRecord::afterValidate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。