class TypedDataMetadata
Same name in other branches
- 8.9.x core/lib/Drupal/Core/TypedData/Validation/TypedDataMetadata.php \Drupal\Core\TypedData\Validation\TypedDataMetadata
- 10 core/lib/Drupal/Core/TypedData/Validation/TypedDataMetadata.php \Drupal\Core\TypedData\Validation\TypedDataMetadata
- 11.x core/lib/Drupal/Core/TypedData/Validation/TypedDataMetadata.php \Drupal\Core\TypedData\Validation\TypedDataMetadata
Validator metadata for typed data objects.
Hierarchy
- class \Drupal\Core\TypedData\Validation\TypedDataMetadata implements \Symfony\Component\Validator\Mapping\MetadataInterface
Expanded class hierarchy of TypedDataMetadata
See also
\Drupal\Core\TypedData\Validation\RecursiveValidator::getMetadataFor()
File
-
core/
lib/ Drupal/ Core/ TypedData/ Validation/ TypedDataMetadata.php, line 15
Namespace
Drupal\Core\TypedData\ValidationView source
class TypedDataMetadata implements MetadataInterface {
/**
* The typed data object the metadata is about.
*
* @var \Drupal\Core\TypedData\TypedDataInterface
*/
protected $typedData;
/**
* Constructs the object.
*
* @param \Drupal\Core\TypedData\TypedDataInterface $typed_data
* The typed data object the metadata is about.
*/
public function __construct(TypedDataInterface $typed_data) {
$this->typedData = $typed_data;
}
/**
* {@inheritdoc}
*/
public function findConstraints($group) : array {
return $this->getConstraints();
}
/**
* {@inheritdoc}
*/
public function getConstraints() : array {
return $this->typedData
->getConstraints();
}
/**
* {@inheritdoc}
*/
public function getTraversalStrategy() : int {
return TraversalStrategy::NONE;
}
/**
* {@inheritdoc}
*/
public function getCascadingStrategy() : int {
// By default, never cascade into validating referenced data structures.
return CascadingStrategy::NONE;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
TypedDataMetadata::$typedData | protected | property | The typed data object the metadata is about. |
TypedDataMetadata::findConstraints | public | function | |
TypedDataMetadata::getCascadingStrategy | public | function | |
TypedDataMetadata::getConstraints | public | function | |
TypedDataMetadata::getTraversalStrategy | public | function | |
TypedDataMetadata::__construct | public | function | Constructs the object. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.