You are here

public function DatasourcePluginBase::getBundles in Search API 8

Retrieves the bundles associated to this datasource.

Return value

string[] An associative array mapping the datasource's bundles' IDs to their labels. If the datasource doesn't contain any bundles, a single pseudo-bundle should be returned, usually equal to the datasource identifier (and label).

Overrides DatasourceInterface::getBundles

1 method overrides DatasourcePluginBase::getBundles()
ContentEntity::getBundles in src/Plugin/search_api/datasource/ContentEntity.php
Retrieves the bundles associated to this datasource.

File

src/Datasource/DatasourcePluginBase.php, line 123

Class

DatasourcePluginBase
Defines a base class from which other datasources may extend.

Namespace

Drupal\search_api\Datasource

Code

public function getBundles() {
  return [
    $this
      ->getPluginId() => $this
      ->label(),
  ];
}