You are here

public function ValidatorBuilder::addXmlMappings in Plug 7

Adds a list of XML constraint mapping files to the validator.

Parameters

array $paths The paths to the mapping files:

Return value

ValidatorBuilderInterface The builder object

Overrides ValidatorBuilderInterface::addXmlMappings

File

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

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

public function addXmlMappings(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->xmlMappings = array_merge($this->xmlMappings, $paths);
  return $this;
}