当前位置: 首页>>代码示例>>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;未经允许,请勿转载。