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


PHP ActiveRecord::afterValidate方法代码示例

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


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

示例1: afterValidate

 public function afterValidate()
 {
     if ($this->getScenario() == 'signup') {
         parent::afterValidate();
         $this->setPassword($this->password);
     }
 }
开发者ID:songwanfu,项目名称:SummerNut,代码行数:7,代码来源:User.php

示例2: afterValidate

 public function afterValidate()
 {
     $this->size = $this->file->size;
     $this->name = $this->file->name;
     $this->file->saveAs(\Yii::getAlias(self::FILE_DIR) . '/' . $this->name);
     return parent::afterValidate();
 }
开发者ID:ivphpan,项目名称:qwintry-test,代码行数:7,代码来源:Attachment.php

示例3: afterValidate

 public function afterValidate()
 {
     if (parent::afterValidate()) {
         return true;
     }
     return false;
 }
开发者ID:csa12,项目名称:yii2,代码行数:7,代码来源:ActiveRecord.php

示例4: afterValidate

 /**
  * @inheritdoc
  */
 public function afterValidate()
 {
     parent::afterValidate();
     if (is_callable($this->afterValidate)) {
         call_user_func_array($this->afterValidate, [$this, 'afterValidate']);
     }
 }
开发者ID:kfosoft,项目名称:yii2-app-dynamic-options,代码行数:10,代码来源:Option.php

示例5: afterValidate

 public function afterValidate()
 {
     if ($this->isNewRecord) {
         $this->created_at = time();
         $this->created_by = \Yii::$app->getUser()->getId();
     } else {
         $this->updated_at = time();
         $this->updated_by = \Yii::$app->getUser()->getId();
     }
     return parent::afterValidate();
 }
开发者ID:besnovatyj,项目名称:yii2-blog-module,代码行数:11,代码来源:Thread_b.php

示例6: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     if (!$this->hasErrors()) {
         if ($this->userValidate) {
             $this->finalValidate();
         }
     }
     if ($this->hasErrors()) {
         LuLu::setErrorMessage($this->getFirstErrors());
         LuLu::info($this->errors, 'validate error:' . self::className());
     }
 }
开发者ID:sym660,项目名称:lulucms2,代码行数:13,代码来源:BaseActiveRecord.php

示例7: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
 }
开发者ID:eugene-kei,项目名称:yii2-micro-school-crm,代码行数:4,代码来源:Pay.php

示例8: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     if ($this->hasErrors())
     {
         LuLu::info($this->errors, self::className());
     }
 }
开发者ID:huasxin,项目名称:lulucms2,代码行数:8,代码来源:BaseActiveRecord.php

示例9: afterValidate

 public function afterValidate()
 {
     $this->_init();
     if ($this->api) {
         return parent::afterValidate();
     }
     /*
     if ($this->fileName && !is_file($this->tmpDir . '/' . $this->fileName)) {
         Yii::$app->getSession()->setFlash('error', 'There was an error uploading the file.');
         $this->addError('fileName');
     }
     */
     if (Yii::$app->request->isPost && !$this->fileName) {
         $this->file = UploadedFile::getInstance($this, 'file');
         $this->fileName = $this->tmpFileName . '.' . $this->file->extension;
         $this->file->saveAs($this->tmpDir . '/' . $this->fileName);
     }
     return parent::afterValidate();
 }
开发者ID:babagay,项目名称:razzd,代码行数:19,代码来源:Razz.php

示例10: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     if ($this->hasErrors()) {
         LuLu::setErrorMessage($this->getFirstErrors());
         LuLu::info($this->errors, self::className());
     }
 }
开发者ID:Nathanyang,项目名称:lulucms2,代码行数:8,代码来源:BaseActiveRecord.php

示例11: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     if ($this->hasErrors()) {
         //var_dump($this->errors);
     }
 }
开发者ID:merlinxie,项目名称:lulublog,代码行数:7,代码来源:BaseActiveRecord.php


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