public function ValidatorBuilder::addMethodMapping in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/ValidatorBuilder.php \Symfony\Component\Validator\ValidatorBuilder::addMethodMapping()
Enables constraint mapping using the given static method.
Parameters
string $methodName The name of the method:
Return value
ValidatorBuilderInterface The builder object
Overrides ValidatorBuilderInterface::addMethodMapping
File
- vendor/
symfony/ validator/ ValidatorBuilder.php, line 176
Class
- ValidatorBuilder
- The default implementation of {@link ValidatorBuilderInterface}.
Namespace
Symfony\Component\ValidatorCode
public function addMethodMapping($methodName) {
if (null !== $this->metadataFactory) {
throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.');
}
$this->methodMappings[] = $methodName;
return $this;
}