public function afterValidate($event) { if (!$this->owner->hasErrors()) { $this->typecastAttributes(); } }