You are here

public static function SearchPluginDeriverBase::resetStaticDerivativeCaches in Search API Autocomplete 8

Resets the statically cached derivatives for all instances of this class.

Parameters

string|null $base_plugin_id: (optional) If given, only reset the caches on derivers for the given base plugin ID.

4 calls to SearchPluginDeriverBase::resetStaticDerivativeCaches()
search_api_autocomplete_search_api_page_delete in ./search_api_autocomplete.module
Implements hook_ENTITY_TYPE_delete() for type "search_api_page".
search_api_autocomplete_search_api_page_insert in ./search_api_autocomplete.module
Implements hook_ENTITY_TYPE_insert() for type "search_api_page".
search_api_autocomplete_view_delete in ./search_api_autocomplete.module
Implements hook_ENTITY_TYPE_delete() for type "view".
search_api_autocomplete_view_insert in ./search_api_autocomplete.module
Implements hook_ENTITY_TYPE_insert() for type "view".

File

src/Search/SearchPluginDeriverBase.php, line 58

Class

SearchPluginDeriverBase
Provides a base class for search plugin derivers.

Namespace

Drupal\search_api_autocomplete\Search

Code

public static function resetStaticDerivativeCaches($base_plugin_id = NULL) {
  $instances = static::$instances;
  if ($base_plugin_id) {
    $instances = !empty($instances[$base_plugin_id]) ? $instances[$base_plugin_id] : [];
  }
  foreach ($instances as $deriver) {
    $deriver->derivatives = NULL;
  }
}