public function addPropertyConstraint($property, Constraint $constraint)
    {
        if (!isset($this->properties[$property])) {
            $this->properties[$property] = new PropertyMetadata($this->getClassName(), $property);

            $this->addPropertyMetadata($this->properties[$property]);
        }

        $constraint->addImplicitGroupName($this->getDefaultGroup());

        $this->properties[$property]->addConstraint($constraint);

        return $this;
    }
public function addPropertyConstraint($property, Constraint $constraint)
    {
        if (!isset($this->properties[$property])) {
            $this->properties[$property] = new PropertyMetadata($this->getClassName(), $property);

            $this->addPropertyMetadata($this->properties[$property]);
        }

        $constraint->addImplicitGroupName($this->getDefaultGroup());

        $this->properties[$property]->addConstraint($constraint);

        return $this;
    }
public function addPropertyConstraint ( $ property , Constraint $ constraint ) { if ( ! isset ( $ this -> properties [ $ property ] ) ) { $ this -> properties [ $ property ] = new PropertyMetadata ( $ this -> getClassName ( ) , $ property ) ; $ this -> addPropertyMetadata ( $ this -> properties [ $ property ] ) ; } $ constraint -> addImplicitGroupName ( $ this -> getDefaultGroup ( ) ) ; $ this -> properties [ $ property ] -> addConstraint ( $ constraint ) ; return $ this ; }
Adds a constraint to the given property.

@param string     $property   The name of the property
@param Constraint $constraint The constraint

@return $this
Adds a constraint to the given property .