mirocow\eav\EavBehavior::beforeValidate PHP Method

beforeValidate() public method

public beforeValidate ( )
    public function beforeValidate()
    {
        static $running;
        if (empty($running)) {
            $running = true;
            $attributeNames = $this->owner->activeAttributes();
            foreach ($attributeNames as $attributeName) {
                if (preg_match('~c\\d+~', $attributeName)) {
                    if (!EavAttribute::find()->where(['name' => $attributeName])->exists()) {
                        throw new Exception(\Yii::t('eav', 'Attribute {name} not found', ['name' => $attributeName]));
                    }
                }
            }
            return $this->owner->validate();
        }
        $running = false;
    }