Adds a constraint to the given property.
string $property The name of the property:
Constraint $constraint The constraint:
ClassMetadata This object
public function addPropertyConstraint($property, Constraint $constraint) {
if (!isset($this->properties[$property])) {
$this->properties[$property] = new PropertyMetadata($this
->getClassName(), $property);
$this
->addMemberMetadata($this->properties[$property]);
}
$constraint
->addImplicitGroupName($this
->getDefaultGroup());
$this->properties[$property]
->addConstraint($constraint);
return $this;
}