本文整理汇总了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();
}
示例2: beforeValidate
public function beforeValidate()
{
foreach ($this->jsonAttributes as $attribute) {
$this->jsonValidation($attribute);
}
return parent::beforeValidate();
}
示例3: beforeValidate
public function beforeValidate()
{
if ($this->is_organization == 1) {
$this->scenario = 'jur-validate';
}
return parent::beforeValidate();
}
示例4: beforeValidate
public function beforeValidate()
{
if (parent::beforeValidate()) {
$this->beforeValidateParamRows();
return true;
} else {
return false;
}
}
示例5: beforeValidate
/** @inheritdoc */
public function beforeValidate()
{
if (parent::beforeValidate()) {
$this->user = User::findIdentityByLogin($this->login);
return true;
} else {
return false;
}
}
示例6: beforeValidate
/** @inheritdoc */
public function beforeValidate()
{
if (parent::beforeValidate()) {
$this->user = $this->module->manager->findUserByUsernameOrEmail($this->login);
return true;
} else {
return false;
}
}
示例7: beforeValidate
public function beforeValidate()
{
if ($this->rememberMe == 'on') {
$this->rememberMe = 1;
} else {
$this->rememberMe = 0;
}
return parent::beforeValidate();
}
示例8: beforeValidate
/** @inheritdoc */
public function beforeValidate()
{
if (Model::beforeValidate()) {
$this->user = $this->finder->findUserByEmail($this->email);
return true;
} else {
return false;
}
}
示例9: beforeValidate
/** @inheritdoc */
public function beforeValidate()
{
if (parent::beforeValidate()) {
$this->user = User::findIdentityByUsernameOrEmail(trim($this->login));
return true;
} else {
return false;
}
}
示例10: beforeValidate
/**
* @inheritdoc
*/
public function beforeValidate()
{
if (!parent::beforeValidate()) {
return false;
}
foreach ($this->activeAttributes() as $attribute) {
$this->preparedData[$attribute] = $this->{$attribute};
}
return true;
}
示例11: beforeValidate
public function beforeValidate()
{
if (parent::beforeValidate()) {
if (Yii::$app->getModule('auth')->signupWithEmailOnly) {
$this->username = $this->email;
}
return true;
}
return false;
}
示例12: beforeValidate
/**
* @inheritdoc
*/
public function beforeValidate()
{
if (parent::beforeValidate()) {
foreach ($this->items as $item) {
if (!$item->validate()) {
return false;
}
}
}
return true;
}
示例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;
}
}
示例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();
}
示例15: beforeValidate
/**
* Перед валидацией получаем
* экземпляр объекта файла
*
* @return bool
*/
public function beforeValidate()
{
$this->file = UploadedFile::getInstanceByName('file');
return parent::beforeValidate();
}