You are here

public function ExecutionContext::getMetadata in Plug 7

Same name in this branch
  1. 7 lib/Symfony/validator/Symfony/Component/Validator/ExecutionContext.php \Symfony\Component\Validator\ExecutionContext::getMetadata()
  2. 7 lib/Symfony/validator/Symfony/Component/Validator/Context/ExecutionContext.php \Symfony\Component\Validator\Context\ExecutionContext::getMetadata()

Returns the metadata for the currently validated value.

With the core implementation, this method returns a {@link Mapping\ClassMetadata} 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.

Return value

MetadataInterface|null The metadata of the currently validated value.

Overrides ExecutionContextInterface::getMetadata

File

lib/Symfony/validator/Symfony/Component/Validator/Context/ExecutionContext.php, line 271

Class

ExecutionContext
The context used and created by {@link ExecutionContextFactory}.

Namespace

Symfony\Component\Validator\Context

Code

public function getMetadata() {
  return $this->metadata;
}