Symfony\Component\Validator\Validator::validateGraph PHP Method

validateGraph() protected method

protected validateGraph ( $root, Closure $walk, $groups = null )
$walk Closure
    protected function validateGraph($root, \Closure $walk, $groups = null)
    {
        $walker = new GraphWalker($root, $this->metadataFactory, $this->validatorFactory);
        $groups = $groups ? (array) $groups : array(Constraint::DEFAULT_GROUP);

        foreach ($groups as $group) {
            $walk($walker, $group);
        }

        return $walker->getViolations();
    }