Respect\Validation\Exceptions\NestedValidationException::getRelatedByName PHP Method

getRelatedByName() public method

public getRelatedByName ( $name ) : ValidationException
return ValidationException
    public function getRelatedByName($name)
    {
        if ($this->isRelated($name, $this)) {
            return $this;
        }
        foreach ($this->getRecursiveIterator() as $exception) {
            if ($this->isRelated($name, $exception)) {
                return $exception;
            }
        }
    }