@author Bernhard Schussek <bschussek@gmail.com>
@api
Expanded class hierarchy of BlankValidator
class BlankValidator extends ConstraintValidator {
/**
* {@inheritDoc}
*/
public function validate($value, Constraint $constraint) {
if ('' !== $value && null !== $value) {
$this->context
->addViolation($constraint->message, array(
'{{ value }}' => $value,
));
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConstraintValidator:: |
public | function |
Initializes the constraint validator. Overrides ConstraintValidatorInterface:: |
1 |
ConstraintValidator:: |
protected | property | ||
BlankValidator:: |
public | function |
Checks if the passed value is valid. Overrides ConstraintValidatorInterface:: |