function ValidatorBuilder::addMethodMappings
Enables constraint mapping using the given static methods.
Parameters
string[] $methodNames The names of the methods:
Return value
$this
File
-
vendor/
symfony/ validator/ ValidatorBuilder.php, line 174
Class
- ValidatorBuilder
- @author Bernhard Schussek <bschussek@gmail.com>
Namespace
Symfony\Component\ValidatorCode
public function addMethodMappings(array $methodNames) : static {
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 = array_merge($this->methodMappings, $methodNames);
return $this;
}