ContextualValidatorInterface.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Drupal\Core\TypedData\Validation;
  3. use Symfony\Component\Validator\Validator\ContextualValidatorInterface as ContextualValidatorInterfaceBase;
  4. /**
  5. * Extends the contextual validator validate method by a new parameter.
  6. */
  7. interface ContextualValidatorInterface extends ContextualValidatorInterfaceBase {
  8. /**
  9. * Validates a value against a constraint or a list of constraints.
  10. *
  11. * If no constraint is passed, the constraint
  12. * \Symfony\Component\Validator\Constraints\Valid is assumed.
  13. *
  14. * @param mixed $value
  15. * The value to validate
  16. * @param \Symfony\Component\Validator\Constraint|\Symfony\Component\Validator\Constraint[] $constraints
  17. * The constraint(s) to validate against.
  18. * @param array|null $groups
  19. * The validation groups to validate, defaults to "Default".
  20. * @param bool $is_root_call
  21. * (optional) Whether its the most upper call in the typed data tree.
  22. *
  23. * @see \Symfony\Component\Validator\Constraints\Valid
  24. *
  25. * @return $this
  26. */
  27. public function validate($value, $constraints = NULL, $groups = NULL, $is_root_call = TRUE);
  28. }