You are here

public function DataFieldRow::init in Drupal 10

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()
  2. 9 core/modules/rest/src/Plugin/views/row/DataFieldRow.php \Drupal\rest\Plugin\views\row\DataFieldRow::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);
  }
}