Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DataFieldRow.php

function DataFieldRow::extractFromOptionsArray

Extracts a set of option values from a nested options array.

Parameters

string $key: The key to extract from each array item.

array $options: The options array to return values from.

Return value

array A regular one dimensional array of values.

2 calls to DataFieldRow::extractFromOptionsArray()
DataFieldRow::init in core/modules/rest/src/Plugin/views/row/DataFieldRow.php
Initialize the plugin.
DataFieldRow::validateOptionsForm in core/modules/rest/src/Plugin/views/row/DataFieldRow.php
Validate the options form.

File

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

Class

DataFieldRow
Plugin which displays fields as raw data.

Namespace

Drupal\rest\Plugin\views\row

Code

protected static function extractFromOptionsArray($key, $options) {
    return array_map(function ($item) use ($key) {
        return $item[$key] ?? NULL;
    }, $options);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal