public function getConstraint(\ReflectionProperty $reflectionProperty, $constraintClass, $getFromAll = true)
    {
        if (
            ($constraint = $this->reader->getPropertyAnnotation($reflectionProperty, $constraintClass)) &&
            $constraint instanceof Constraint
        ) {
            return $constraint;
        }

        // if not found, and not searching the All Constraint, return
        if (!$getFromAll) {
            return;
        }

        if (
            ($allConstraint = $this->getConstraintFromAll($reflectionProperty, $constraintClass)) &&
            $allConstraint instanceof Constraint
        ) {
            return $allConstraint;
        }
    }
public function getConstraint(\ReflectionProperty $reflectionProperty, $constraintClass, $getFromAll = true)
    {
        if (
            ($constraint = $this->reader->getPropertyAnnotation($reflectionProperty, $constraintClass)) &&
            $constraint instanceof Constraint
        ) {
            return $constraint;
        }

        // if not found, and not searching the All Constraint, return
        if (!$getFromAll) {
            return;
        }

        if (
            ($allConstraint = $this->getConstraintFromAll($reflectionProperty, $constraintClass)) &&
            $allConstraint instanceof Constraint
        ) {
            return $allConstraint;
        }
    }
public function getConstraint ( \ ReflectionProperty $ reflectionProperty , $ constraintClass , $ getFromAll = true ) { if ( ( $ constraint = $ this -> reader -> getPropertyAnnotation ( $ reflectionProperty , $ constraintClass ) ) && $ constraint instanceof Constraint ) { return $ constraint ; } // if not found, and not searching the All Constraint, return if ( ! $ getFromAll ) { return ; } if ( ( $ allConstraint = $ this -> getConstraintFromAll ( $ reflectionProperty , $ constraintClass ) ) && $ allConstraint instanceof Constraint ) { return $ allConstraint ; } }
Retrieve a specific constraint of a property ; defaults to retrieving from the All constraint if that exists.

@param \ReflectionProperty $reflectionProperty
@param string $constraintClass
@param bool $getFromAll whether to search an All constraint of the property
@return Constraint|null
Retrieve a specific constraint of a property ; defaults to retrieving from the All constraint if that exists .