function ClassMetadata::addGetterMethodConstraint
Adds a constraint to the getter of the given property.
Return value
$this
1 call to ClassMetadata::addGetterMethodConstraint()
- ClassMetadata::addGetterMethodConstraints in vendor/
symfony/ validator/ Mapping/ ClassMetadata.php
File
-
vendor/
symfony/ validator/ Mapping/ ClassMetadata.php, line 279
Class
- ClassMetadata
- Default implementation of {@link ClassMetadataInterface}.
Namespace
Symfony\Component\Validator\MappingCode
public function addGetterMethodConstraint(string $property, string $method, Constraint $constraint) : static {
if (!isset($this->getters[$property])) {
$this->getters[$property] = new GetterMetadata($this->getClassName(), $property, $method);
$this->addPropertyMetadata($this->getters[$property]);
}
$constraint->addImplicitGroupName($this->getDefaultGroup());
$this->getters[$property]
->addConstraint($constraint);
return $this;
}