You are here

public function DatasourcePluginBase::getListCacheContexts in Search API 8

Returns the list cache contexts associated with this datasource.

List cache contexts ensure that if items from a datasource are included in a list that any caches containing this list are varied as necessary. For example a view might contain a number of items from this datasource that are visible only by users that have a certain role. These list cache contexts will ensure that separate cached versions exist for users with this role and without it. These contexts should be included whenever a list is rendered that contains items from this datasource.

Return value

string[] The list cache contexts associated with this datasource.

Overrides DatasourceInterface::getListCacheContexts

1 call to DatasourcePluginBase::getListCacheContexts()
ContentEntity::getListCacheContexts in src/Plugin/search_api/datasource/ContentEntity.php
Returns the list cache contexts associated with this datasource.
1 method overrides DatasourcePluginBase::getListCacheContexts()
ContentEntity::getListCacheContexts in src/Plugin/search_api/datasource/ContentEntity.php
Returns the list cache contexts associated with this datasource.

File

src/Datasource/DatasourcePluginBase.php, line 185

Class

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

Namespace

Drupal\search_api\Datasource

Code

public function getListCacheContexts() {
  return [];
}