Validation change protected field to public

I am trying to fetch the field name, that im currently validating. But the virable is a protected function, how can i print it out? I tried to change public $_field inside my custom validation class, that extends the validation class. But it dosent work...

How can I print it out?

$validation = new \Validation\Validate();

    $messages = $validation->validate($_POST);

    if (count($messages)) {
        foreach ($messages as $message) {
            echo $message->_field;

I found out that i could use this function:


edited Jul '15

A little idea u can use- new function in model: (example is from here for more details)

    public function getMessages($filter = NULL)
        $messages = [];

        foreach (parent::getMessages($filter) as $message) {
            switch ($message->getType()) {
                case 'PresenceOf':
                    $messages[] = $message->getField().": Field is required");
                    $messages[] = $message->getMessage();

        return $messages;