You are here

public function SearchApiQuery::getEntityTypes in Search API 8

Checks for entity types contained in the current view's index.

Parameters

bool $return_bool: (optional) If TRUE, returns a boolean instead of a list of datasources.

Return value

string[]|bool If $return_bool is FALSE, an associative array mapping all datasources containing entities to their entity types. Otherwise, TRUE if there is at least one such datasource.

Deprecated

in search_api:8.x-1.5 and is removed from search_api:2.0.0. Use \Drupal\search_api\IndexInterface::getEntityTypes() instead.

See also

https://www.drupal.org/node/2899682

File

src/Plugin/views/query/SearchApiQuery.php, line 429

Class

SearchApiQuery
Defines a Views query class for searching on Search API indexes.

Namespace

Drupal\search_api\Plugin\views\query

Code

public function getEntityTypes($return_bool = FALSE) {
  @trigger_error('\\Drupal\\search_api\\Plugin\\views\\query\\SearchApiQuery::getEntityTypes() is deprecated in Search API 8.x-1.5. Use \\Drupal\\search_api\\IndexInterface::getEntityTypes() instead. See https://www.drupal.org/node/2899682', E_USER_DEPRECATED);
  $types = $this->index
    ->getEntityTypes();
  return $return_bool ? (bool) $types : $types;
}