You are here

public function DataProviderVariable::getIndexIds in RESTful 7.2

Returns the ID to render for the current index GET request.

Return value

array Numeric array containing the identifiers to be sent to viewMultiple.

Overrides DataProviderInterface::getIndexIds

1 call to DataProviderVariable::getIndexIds()
DataProviderVariable::count in modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
Counts the total results for the index call.

File

modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php, line 145
Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariable.

Class

DataProviderVariable
Class DataProviderVariable.

Namespace

Drupal\restful_example\Plugin\resource\variables

Code

public function getIndexIds() {
  $output = array();
  foreach ($GLOBALS['conf'] as $key => $value) {
    $output[] = array(
      'name' => $key,
      'value' => $value,
    );
  }

  // Apply filters.
  $output = $this
    ->applyFilters($output);
  $output = $this
    ->applySort($output);
  return array_map(function ($item) {
    return $item['name'];
  }, $output);
}