public function RecursiveValidator::startContext

public RecursiveValidator::startContext($root = NULL)

Starts a new validation context and returns a validator for that context.

The returned validator collects all violations generated within its context. You can access these violations with the {@link ContextualValidatorInterface::getViolations()} method.

Return value

ContextualValidatorInterface The validator for the new context

Overrides ValidatorInterface::startContext

File

core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php, line 54

Class

RecursiveValidator
Defines a recursive validator for Typed Data.

Namespace

Drupal\Core\TypedData\Validation

Code

public function startContext($root = NULL) {
  return new RecursiveContextualValidator($this->contextFactory->createContext($this, $root), $this, $this->constraintValidatorFactory, $this->typedDataManager);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!Validation!RecursiveValidator.php/function/RecursiveValidator::startContext/8.1.x