function ValidatorBuilder::enableAttributeMapping
Enables attribute-based constraint mapping.
Return value
$this
File
-
vendor/
symfony/ validator/ ValidatorBuilder.php, line 190
Class
- ValidatorBuilder
- @author Bernhard Schussek <bschussek@gmail.com>
Namespace
Symfony\Component\ValidatorCode
public function enableAttributeMapping() : static {
if (null !== $this->metadataFactory) {
throw new ValidatorException('You cannot enable attribute mapping after setting a custom metadata factory. Configure your metadata factory instead.');
}
$this->enableAttributeMapping = true;
return $this;
}