public getTargets ( ) : string | array | ||
Результат | string | array | One or more constant values |
public function getTargets()
{
return self::PROPERTY_CONSTRAINT;
}
/** * {@inheritDoc} */ public function addConstraint(Constraint $constraint) { if (!in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets())) { throw new ConstraintDefinitionException(sprintf('The constraint %s cannot be put on classes', get_class($constraint))); } $constraint->addImplicitGroupName($this->getDefaultGroup()); parent::addConstraint($constraint); }