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


PHP Model::beforeValidate方法代码示例

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


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

示例1: beforeValidate

 /**
  * Method description
  *
  * @return mixed The return value
  */
 public function beforeValidate()
 {
     if (!empty($this->otherType)) {
         $this->type = $this->otherType;
     }
     return parent::beforeValidate();
 }
开发者ID:chitwarnold,项目名称:yii2-wizard,代码行数:12,代码来源:Get.php

示例2: beforeValidate

 public function beforeValidate()
 {
     foreach ($this->jsonAttributes as $attribute) {
         $this->jsonValidation($attribute);
     }
     return parent::beforeValidate();
 }
开发者ID:bariew,项目名称:yii2-config-cms-module,代码行数:7,代码来源:Config.php

示例3: beforeValidate

 public function beforeValidate()
 {
     if ($this->is_organization == 1) {
         $this->scenario = 'jur-validate';
     }
     return parent::beforeValidate();
 }
开发者ID:HejVkt,项目名称:auto.only3.ru,代码行数:7,代码来源:Prepare.php

示例4: beforeValidate

 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         $this->beforeValidateParamRows();
         return true;
     } else {
         return false;
     }
 }
开发者ID:heartshare,项目名称:yii2-rest-1,代码行数:9,代码来源:RequestForm.php

示例5: beforeValidate

 /** @inheritdoc */
 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         $this->user = User::findIdentityByLogin($this->login);
         return true;
     } else {
         return false;
     }
 }
开发者ID:heartshare,项目名称:yii2-user-plus,代码行数:10,代码来源:BaseLoginForm.php

示例6: beforeValidate

 /** @inheritdoc */
 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         $this->user = $this->module->manager->findUserByUsernameOrEmail($this->login);
         return true;
     } else {
         return false;
     }
 }
开发者ID:jboy1009,项目名称:yii2-simple,代码行数:10,代码来源:LoginForm.php

示例7: beforeValidate

 public function beforeValidate()
 {
     if ($this->rememberMe == 'on') {
         $this->rememberMe = 1;
     } else {
         $this->rememberMe = 0;
     }
     return parent::beforeValidate();
 }
开发者ID:hoangngk,项目名称:adminpanel,代码行数:9,代码来源:LoginForm.php

示例8: beforeValidate

 /** @inheritdoc */
 public function beforeValidate()
 {
     if (Model::beforeValidate()) {
         $this->user = $this->finder->findUserByEmail($this->email);
         return true;
     } else {
         return false;
     }
 }
开发者ID:itnelo,项目名称:digitaldali-portal-template-php-yii2,代码行数:10,代码来源:LoginForm.php

示例9: beforeValidate

 /** @inheritdoc */
 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         $this->user = User::findIdentityByUsernameOrEmail(trim($this->login));
         return true;
     } else {
         return false;
     }
 }
开发者ID:yujin1st,项目名称:yii2-user,代码行数:10,代码来源:LoginForm.php

示例10: beforeValidate

 /**
  * @inheritdoc
  */
 public function beforeValidate()
 {
     if (!parent::beforeValidate()) {
         return false;
     }
     foreach ($this->activeAttributes() as $attribute) {
         $this->preparedData[$attribute] = $this->{$attribute};
     }
     return true;
 }
开发者ID:bupy7,项目名称:yii2-datetime-converter,代码行数:13,代码来源:Post.php

示例11: beforeValidate

 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         if (Yii::$app->getModule('auth')->signupWithEmailOnly) {
             $this->username = $this->email;
         }
         return true;
     }
     return false;
 }
开发者ID:johnparra,项目名称:yii2-auth,代码行数:10,代码来源:SignupForm.php

示例12: beforeValidate

 /**
  * @inheritdoc
  */
 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         foreach ($this->items as $item) {
             if (!$item->validate()) {
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:dawei101,项目名称:yii2-admin-module,代码行数:14,代码来源:Category.php

示例13: beforeValidate

 public function beforeValidate()
 {
     if (parent::beforeValidate()) {
         $this->prepareRows($this->queryKeys, $this->queryValues, $this->queryActives);
         $this->prepareRows($this->bodyKeys, $this->bodyValues, $this->bodyActives);
         $this->prepareRows($this->headerKeys, $this->headerValues, $this->headerActives);
         return true;
     } else {
         return false;
     }
 }
开发者ID:davidfang,项目名称:yii2-rest-1,代码行数:11,代码来源:RequestForm.php

示例14: beforeValidate

 public function beforeValidate()
 {
     $dateObj = \yii::$app->DateComponent;
     if ($this->end_date == null) {
         $this->end_date = $this->start_date;
     }
     $this->start_datetime_uk = sprintf('%s %s', $this->start_date, $this->start_time);
     $this->end_datetime_uk = sprintf('%s %s', $this->end_date, $this->end_time);
     $this->start_timestamp = $dateObj->ukDateTimeToTimestamp($this->start_datetime_uk);
     $this->end_timestamp = $dateObj->ukDateTimeToTimestamp($this->end_datetime_uk);
     if ($this->end_timestamp - $this->start_timestamp > $this->secsInDay) {
         $this->all_day_option_id = Types::$boolean['true']['id'];
     }
     return parent::beforeValidate();
 }
开发者ID:spiro-stathakis,项目名称:projects,代码行数:15,代码来源:Booking.php

示例15: beforeValidate

 /**
  * Перед валидацией получаем
  * экземпляр объекта файла
  *
  * @return bool
  */
 public function beforeValidate()
 {
     $this->file = UploadedFile::getInstanceByName('file');
     return parent::beforeValidate();
 }
开发者ID:beowulfenator,项目名称:yii2-dynamic-image,代码行数:11,代码来源:ImageUploadForm.php


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