/** * Get all validation errors against the current model object but qualify the keys to be form input ids * @return array */ public function getQualifiedErrorMessageWithInputIds() { // get the form name $formName = \GGS\Helpers\FormHelper::getName(get_class($this)); $qualifiedErrorMessages = array(); foreach ($this->getErrors() as $attribute => $error) { // qualify the key to be input id $inputId = FormHelper::resolveInputId($formName, $attribute); $qualifiedErrorMessages[$inputId] = $error; } return $qualifiedErrorMessages; }