public function beforeValidate() { if (parent::beforeValidate()) { $this->setScenario($this->getTypeScenario()); return true; } return false; }