You are here

interface ContextualValidatorInterface in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Validator/ContextualValidatorInterface.php \Symfony\Component\Validator\Validator\ContextualValidatorInterface
  2. 8 core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php \Drupal\Core\TypedData\Validation\ContextualValidatorInterface
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php \Drupal\Core\TypedData\Validation\ContextualValidatorInterface

Extends the contextual validator validate method by a new parameter.

Hierarchy

Expanded class hierarchy of ContextualValidatorInterface

All classes that implement ContextualValidatorInterface

File

core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php, line 15
Contains \Drupal\Core\TypedData\Validation\ContextualValidatorInterface.

Namespace

Drupal\Core\TypedData\Validation
View source
interface ContextualValidatorInterface extends ContextualValidatorInterfaceBase {

  /**
   * Validates a value against a constraint or a list of constraints.
   *
   * If no constraint is passed, the constraint
   * \Symfony\Component\Validator\Constraints\Valid is assumed.
   *
   * @param mixed $value
   *   The value to validate
   * @param \Symfony\Component\Validator\Constraint|\Symfony\Component\Validator\Constraint[] $constraints
   *   The constraint(s) to validate against.
   * @param array|null $groups
   *   The validation groups to validate, defaults to "Default".
   * @param bool $is_root_call
   *   (optional) Whether its the most upper call in the typed data tree.
   *
   * @see \Symfony\Component\Validator\Constraints\Valid
   *
   * @return $this
   */
  public function validate($value, $constraints = NULL, $groups = NULL, $is_root_call = TRUE);

}

Members

Namesort descending Modifiers Type Description Overrides
ContextualValidatorInterface::atPath public function Appends the given path to the property path of the context. 2
ContextualValidatorInterface::getViolations public function Returns the violations that have been generated so far in the context of the validator. 2
ContextualValidatorInterface::validate public function Validates a value against a constraint or a list of constraints. Overrides ContextualValidatorInterface::validate
ContextualValidatorInterface::validateProperty public function Validates a property of an object against the constraints specified for this property. 2
ContextualValidatorInterface::validatePropertyValue public function Validates a value against the constraints specified for an object's property. 2