You are here

public function JsonapiHelper::buildEntitiesOptions in Entity Share 8.2

Same name and namespace in other branches
  1. 8 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.

\Drupal\entity_share_client\Entity\RemoteInterface $remote: The selected remote.

string $channel_id: The selected channel id.

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 262

Class

JsonapiHelper
Class JsonapiHelper.

Namespace

Drupal\entity_share_client\Service

Code

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