You are here

public function ContentEntity::defaultConfiguration in Search API 8

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides ConfigurablePluginBase::defaultConfiguration

1 call to ContentEntity::defaultConfiguration()
ContentEntity::__construct in src/Plugin/search_api/datasource/ContentEntity.php
Constructs a \Drupal\Component\Plugin\PluginBase object.

File

src/Plugin/search_api/datasource/ContentEntity.php, line 535

Class

ContentEntity
Represents a datasource which exposes the content entities.

Namespace

Drupal\search_api\Plugin\search_api\datasource

Code

public function defaultConfiguration() {
  $default_configuration = [];
  if ($this
    ->hasBundles()) {
    $default_configuration['bundles'] = [
      'default' => TRUE,
      'selected' => [],
    ];
  }
  if ($this
    ->isTranslatable()) {
    $default_configuration['languages'] = [
      'default' => TRUE,
      'selected' => [],
    ];
  }
  return $default_configuration;
}