You are here

protected function SearchApiEntityOperations::getContainedEntity in Search API 8

Retrieves the entity from a search item.

Parameters

\Drupal\Core\TypedData\ComplexDataInterface $item: An item of this datasource's type.

Return value

\Drupal\Core\Entity\EntityInterface|null The entity object represented by that item, or NULL if none could be found.

1 call to SearchApiEntityOperations::getContainedEntity()
SearchApiEntityOperations::render in src/Plugin/views/field/SearchApiEntityOperations.php
Renders the field.

File

src/Plugin/views/field/SearchApiEntityOperations.php, line 74

Class

SearchApiEntityOperations
Renders all operations links for an entity.

Namespace

Drupal\search_api\Plugin\views\field

Code

protected function getContainedEntity(ComplexDataInterface $item) {
  $value = $item
    ->getValue();
  return $value instanceof EntityInterface ? $value : NULL;
}