TypedDataManager::getValidator

public TypedDataManager::getValidator()

Gets the validator for validating typed data.

Return value

\Symfony\Component\Validator\Validator\ValidatorInterface The validator object.

Overrides TypedDataManagerInterface::getValidator

File

core/lib/Drupal/Core/TypedData/TypedDataManager.php, line 213

Class

TypedDataManager
Manages data type plugins.

Namespace

Drupal\Core\TypedData

Code

public function getValidator() {
  if (!isset($this->validator)) {
    $this->validator = new RecursiveValidator(
    new ExecutionContextFactory(new DrupalTranslator()), 
    new ConstraintValidatorFactory($this->classResolver), 
    $this
    );
  }
  return $this->validator;
}
doc_Drupal
2016-10-29 09:50:09
Comments
Leave a Comment

Please login to continue.