protected static 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()

File

drupal/core/modules/rest/lib/Drupal/rest/Plugin/views/row/DataFieldRow.php, line 184
Contains \Drupal\rest\Plugin\views\row\DataFieldRow.

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 isset($item[$key]) ? $item[$key] : NULL;
  }, $options);
}