當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。