You are here

public function FieldsHelper::getInnerProperty in Search API 8

Retrieves the inner property definition of a compound property definition.

This will retrieve the list item type from a list data definition or the definition of the referenced data from a reference data definition.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $property: The original property definition.

Return value

\Drupal\Core\TypedData\DataDefinitionInterface The inner property definition.

Overrides FieldsHelperInterface::getInnerProperty

1 call to FieldsHelper::getInnerProperty()
FieldsHelper::retrieveNestedProperty in src/Utility/FieldsHelper.php
Retrieves a nested property from a list of properties.

File

src/Utility/FieldsHelper.php, line 375

Class

FieldsHelper
Provides helper methods for dealing with Search API fields and properties.

Namespace

Drupal\search_api\Utility

Code

public function getInnerProperty(DataDefinitionInterface $property) {
  while ($property instanceof ListDataDefinitionInterface) {
    $property = $property
      ->getItemDefinition();
  }
  while ($property instanceof DataReferenceDefinitionInterface) {
    $property = $property
      ->getTargetDefinition();
  }
  return $property;
}