You are here

public function DataFieldRow::init in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/rest/src/Plugin/views/row/DataFieldRow.php \Drupal\rest\Plugin\views\row\DataFieldRow::init()

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 PluginBase::init

File

core/modules/rest/src/Plugin/views/row/DataFieldRow.php, line 46

Class

DataFieldRow
Plugin which displays fields as raw data.

Namespace

Drupal\rest\Plugin\views\row

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  if (!empty($this->options['field_options'])) {
    $options = (array) $this->options['field_options'];

    // Prepare a trimmed version of replacement aliases.
    $aliases = static::extractFromOptionsArray('alias', $options);
    $this->replacementAliases = array_filter(array_map('trim', $aliases));

    // Prepare an array of raw output field options.
    $this->rawOutputOptions = static::extractFromOptionsArray('raw_output', $options);
  }
}