You are here

public function ValidatorBuilder::addYamlMapping in Plug 7

Adds a YAML constraint mapping file to the validator.

Parameters

string $path The path to the mapping file:

Return value

ValidatorBuilderInterface The builder object

Overrides ValidatorBuilderInterface::addYamlMapping

File

lib/Symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php, line 156

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

public function addYamlMapping($path) {
  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[] = $path;
  return $this;
}