You are here

public function SearchApiPageDeriver::getDerivativeDefinitions in Search API Pages 8

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/search_api/display/SearchApiPageDeriver.php, line 16

Class

SearchApiPageDeriver
Derives a display plugin definition for all pages.

Namespace

Drupal\search_api_page\Plugin\search_api\display

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  if (isset($this->derivatives)) {
    return $this->derivatives;
  }
  $this->derivatives = [];
  $pages = SearchApiPage::loadMultiple();
  if (empty($pages)) {
    return $this->derivatives;
  }
  $this->derivatives = $this
    ->getDerivatives($pages, $base_plugin_definition);
  return $this->derivatives;
}