You are here

public function Index::getEntityTypes in Search API 8

Retrieves all entity types contained in this index.

Return value

string[] An associative array mapping all datasources containing entities to their entity type IDs.

Overrides IndexInterface::getEntityTypes

File

src/Entity/Index.php, line 414

Class

Index
Defines the search index configuration entity.

Namespace

Drupal\search_api\Entity

Code

public function getEntityTypes($return_bool = FALSE) {
  $types = [];
  foreach ($this
    ->getDatasources() as $datasource_id => $datasource) {
    if ($type = $datasource
      ->getEntityTypeId()) {
      $types[$datasource_id] = $type;
    }
  }
  return $types;
}