You are here

public function RemoteManager::getChannelsInfos in Entity Share 8

Same name and namespace in other branches
  1. 8.3 modules/entity_share_client/src/Service/RemoteManager.php \Drupal\entity_share_client\Service\RemoteManager::getChannelsInfos()
  2. 8.2 modules/entity_share_client/src/Service/RemoteManager.php \Drupal\entity_share_client\Service\RemoteManager::getChannelsInfos()

Get the channels infos of a remote website.

Parameters

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

Return value

array An array of channel infos as returned by entity_share_server entry point.

Overrides RemoteManagerInterface::getChannelsInfos

File

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

Class

RemoteManager
Class RemoteManager.

Namespace

Drupal\entity_share_client\Service

Code

public function getChannelsInfos(RemoteInterface $remote) {
  $http_client = $this
    ->prepareJsonApiClient($remote);
  $json_response = $http_client
    ->get('entity_share')
    ->getBody()
    ->getContents();
  $json = Json::decode($json_response);
  return $json['data']['channels'];
}