You are here

public function ValidatorBuilder::addYamlMappings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/ValidatorBuilder.php \Symfony\Component\Validator\ValidatorBuilder::addYamlMappings()

Adds a list of YAML constraint mappings file to the validator.

Parameters

array $paths The paths to the mapping files:

Return value

ValidatorBuilderInterface The builder object

Overrides ValidatorBuilderInterface::addYamlMappings

File

vendor/symfony/validator/ValidatorBuilder.php, line 162

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

public function addYamlMappings(array $paths) {
  if (null !== $this->metadataFactory) {
    throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.');
  }
  $this->yamlMappings = array_merge($this->yamlMappings, $paths);
  return $this;
}