You are here

public function DataProviderPlug::viewMultiple in RESTful 7.2

Read operation.

Parameters

array $identifiers: The array of IDs of things being viewed.

Return value

array An array of structured data for the things being viewed.

Overrides CrudInterface::viewMultiple

File

src/Plugin/resource/DataProvider/DataProviderPlug.php, line 87
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderPlug.

Class

DataProviderPlug
Class DataProviderPlug.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

public function viewMultiple(array $identifiers) {
  $return = array();
  foreach ($identifiers as $identifier) {
    try {
      $row = $this
        ->view($identifier);
    } catch (InaccessibleRecordException $e) {
      $row = NULL;
    }
    $return[] = $row;
  }
  return array_values(array_filter($return));
}