You are here

public function DatasourcePluginBase::getViewModes in Search API 8

Returns the available view modes for this datasource.

Parameters

string|null $bundle: (optional) The bundle for which to return the available view modes. Or NULL to return all view modes for this datasource, across all bundles.

Return value

string[] An associative array of view mode labels, keyed by the view mode ID. Can be empty if it isn't possible to view items of this datasource.

Overrides DatasourceInterface::getViewModes

1 method overrides DatasourcePluginBase::getViewModes()
ContentEntity::getViewModes in src/Plugin/search_api/datasource/ContentEntity.php
Returns the available view modes for this datasource.

File

src/Datasource/DatasourcePluginBase.php, line 116

Class

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

Namespace

Drupal\search_api\Datasource

Code

public function getViewModes($bundle = NULL) {
  return [];
}