You are here

public function ValidatorBuilder::addXmlMapping in Zircon Profile 8

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

Adds an XML constraint mapping file to the validator.

Parameters

string $path The path to the mapping file:

Return value

ValidatorBuilderInterface The builder object

Overrides ValidatorBuilderInterface::addXmlMapping

File

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

Class

ValidatorBuilder
The default implementation of {@link ValidatorBuilderInterface}.

Namespace

Symfony\Component\Validator

Code

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