You are here

public function JsonapiHelper::buildEntitiesOptions in Entity Share 8

Same name and namespace in other branches
  1. 8.2 modules/entity_share_client/src/Service/JsonapiHelper.php \Drupal\entity_share_client\Service\JsonapiHelper::buildEntitiesOptions()

Prepare entities from an URI to request.

Parameters

array $json_data: An array of data send by the JSON API..

Return value

array The array of options for the tableselect form type element.

Overrides JsonapiHelperInterface::buildEntitiesOptions

File

modules/entity_share_client/src/Service/JsonapiHelper.php, line 187

Class

JsonapiHelper
Class JsonapiHelper.

Namespace

Drupal\entity_share_client\Service

Code

public function buildEntitiesOptions(array $json_data) {
  $options = [];
  foreach ($this
    ->prepareData($json_data) as $data) {
    $this
      ->addOptionFromJson($options, $data);
  }
  return $options;
}