Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExecutionContextInterface.php

function ExecutionContextInterface::getMetadata

Returns the metadata for the currently validated value.

With the core implementation, this method returns a {@link Mapping\ClassMetadataInterface} instance if the current value is an object, a {@link Mapping\PropertyMetadata} instance if the current value is the value of a property and a {@link Mapping\GetterMetadata} instance if the validated value is the result of a getter method.

If the validated value is neither of these, for example if the validator has been called with a plain value and constraint, this method returns null.

2 methods override ExecutionContextInterface::getMetadata()
ExecutionContext::getMetadata in core/lib/Drupal/Core/Validation/ExecutionContext.php
Returns the metadata for the currently validated value.
ExecutionContext::getMetadata in vendor/symfony/validator/Context/ExecutionContext.php
Returns the metadata for the currently validated value.

File

vendor/symfony/validator/Context/ExecutionContextInterface.php, line 228

Class

ExecutionContextInterface
The context of a validation run.

Namespace

Symfony\Component\Validator\Context

Code

public function getMetadata() : ?MetadataInterface;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal