public function getMessage() {
        if ($this->mainMessage) {
            return $this->mainMessage;
        }

        // Generate the message by concatenating all of the errors together.
        $messages = [];
        foreach ($this->errors as $errors) {
            foreach ($errors as $error) {
                $field = val('field', $error, '*');
                if (is_array($field)) {
                    $field = implode(', ', $field);
                }

                if (isset($error['message'])) {
                    $message = $error['message'];
                } elseif (strpos($error['code'], '%s') === false) {
                    $message = sprintft($error['code'].': %s.', $field);
                } else {
                    $message = sprintft($error['code'], $field);
                }

                $messages[] = $message;
            }
        }
        return implode(' ', $messages);
    }
public function getMessage() {
        if ($this->mainMessage) {
            return $this->mainMessage;
        }

        // Generate the message by concatenating all of the errors together.
        $messages = [];
        foreach ($this->errors as $errors) {
            foreach ($errors as $error) {
                $field = val('field', $error, '*');
                if (is_array($field)) {
                    $field = implode(', ', $field);
                }

                if (isset($error['message'])) {
                    $message = $error['message'];
                } elseif (strpos($error['code'], '%s') === false) {
                    $message = sprintft($error['code'].': %s.', $field);
                } else {
                    $message = sprintft($error['code'], $field);
                }

                $messages[] = $message;
            }
        }
        return implode(' ', $messages);
    }
public function getMessage ( ) { if ( $ this -> mainMessage ) { return $ this -> mainMessage ; } // Generate the message by concatenating all of the errors together. $ messages = [ ] ; foreach ( $ this -> errors as $ errors ) { foreach ( $ errors as $ error ) { $ field = val ( 'field' , $ error , '*' ) ; if ( is_array ( $ field ) ) { $ field = implode ( ', ' , $ field ) ; } if ( isset ( $ error [ 'message' ] ) ) { $ message = $ error [ 'message' ] ; } elseif ( strpos ( $ error [ 'code' ] , '%s' ) === false ) { $ message = sprintft ( $ error [ 'code' ] . ': %s.' , $ field ) ; } else { $ message = sprintft ( $ error [ 'code' ] , $ field ) ; } $ messages [ ] = $ message ; } } return implode ( ' ' , $ messages ) ; }
Get the message for this exception.

@return string Returns the exception message.
Get the message for this exception .