public function getValidationErrorsByName($name)
    {
        $errors = [];

        if ($this->name == $name) {
            $errors[] = $this;
        }

        $errors = array_merge($errors, $this->getValidationErrorsByNameRecursive($name, $this->subErrors));

        return $errors;
    }
public function getValidationErrorsByName($name)
    {
        $errors = [];

        if ($this->name == $name) {
            $errors[] = $this;
        }

        $errors = array_merge($errors, $this->getValidationErrorsByNameRecursive($name, $this->subErrors));

        return $errors;
    }
public function getValidationErrorsByName ( $ name ) { $ errors = [ ] ; if ( $ this -> name == $ name ) { $ errors [ ] = $ this ; } $ errors = array_merge ( $ errors , $ this -> getValidationErrorsByNameRecursive ( $ name , $ this -> subErrors ) ) ; return $ errors ; }
Returns an array of validation errors for the validation name provided.

Searches within sub errors as well.

@param  $name
@return array
Returns an array of validation errors for the validation name provided .