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