You are here

public function SearchApiEntityField::init in Search API 8

Initialize the plugin.

Parameters

\Drupal\views\ViewExecutable $view: The view object.

\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The display handler.

array $options: The options configured for this plugin.

Overrides EntityField::init

File

src/Plugin/views/field/SearchApiEntityField.php, line 48

Class

SearchApiEntityField
Displays entity field data.

Namespace

Drupal\search_api\Plugin\views\field

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {

  // Prepare our fallback handler.
  $fallback_handler_id = $this->definition['fallback_handler'] ?? 'search_api';
  $this->fallbackHandler = Views::handlerManager('field')
    ->getHandler($options, $fallback_handler_id);
  $options += [
    'fallback_options' => [],
  ];
  $fallback_options = $options['fallback_options'] + $options;
  $this->fallbackHandler
    ->init($view, $display, $fallback_options);
  parent::init($view, $display, $options);
}