You are here

public function DataFetcherInterface::fetchDefinitionByPropertyPath in Typed Data API enhancements 8

Fetches a data definition based upon the given property path.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $data_definition: The data definition from which to retrieve a nested definition.

string $property_path: The property path string, e.g. "uid.entity.mail.value".

string $langcode: (optional) The language code used to get the argument value if the argument value should be translated. Defaults to NULL.

Return value

\Drupal\Core\TypedData\DataDefinitionInterface The data definition of the target.

Throws

\Drupal\typed_data\Exception\InvalidArgumentException Thrown if the given path is not valid for the given data; e.g., a not existing property is referenced.

1 method overrides DataFetcherInterface::fetchDefinitionByPropertyPath()
DataFetcher::fetchDefinitionByPropertyPath in src/DataFetcher.php
Fetches a data definition based upon the given property path.

File

src/DataFetcherInterface.php, line 82

Class

DataFetcherInterface
Interface for the DataFetcher service.

Namespace

Drupal\typed_data

Code

public function fetchDefinitionByPropertyPath(DataDefinitionInterface $data_definition, $property_path, $langcode = NULL);