You are here

public function FormHelper::buildEntitiesOptions in Entity Share 8.3

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 FormHelperInterface::buildEntitiesOptions

File

modules/entity_share_client/src/Service/FormHelper.php, line 123

Class

FormHelper
Service to extract code out of the PullForm.

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;
}