You are here

public function RemoteManager::getfieldMappings in Entity Share 8.3

Get the field mappings of a remote website.

Parameters

\Drupal\entity_share_client\Entity\RemoteInterface $remote: The remote website on which to get the field mappings.

Return value

array Field mappings as returned by entity_share_server entry point.

Overrides RemoteManagerInterface::getfieldMappings

File

modules/entity_share_client/src/Service/RemoteManager.php, line 117

Class

RemoteManager
Service to wrap requests logic.

Namespace

Drupal\entity_share_client\Service

Code

public function getfieldMappings(RemoteInterface $remote) {
  $remote_id = $remote
    ->id();
  if (!isset($this->remoteInfos[$remote_id])) {
    $response = $this
      ->jsonApiRequest($remote, 'GET', 'entity_share');
    $json = Json::decode((string) $response
      ->getBody());
    $this->remoteInfos[$remote_id] = $json['data'];
  }
  return $this->remoteInfos[$remote_id]['field_mappings'];
}