You are here

public function RestClient::__construct in Salesforce Suite 8.3

Same name in this branch
  1. 8.3 src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::__construct()
  2. 8.3 modules/salesforce_encrypt/src/Rest/RestClient.php \Drupal\salesforce_encrypt\Rest\RestClient::__construct()
Same name and namespace in other branches
  1. 8.4 src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::__construct()
  2. 5.0.x src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::__construct()

Constructor which initializes the consumer.

Parameters

\GuzzleHttp\ClientInterface $http_client: The GuzzleHttp Client.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.

\Drupal\Core\State\StateInterface $state: The state service.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache service.

\Drupal\Component\Serialization\Json $json: The JSON serializer service.

\Drupal\Component\Datetime\TimeInterface $time: The Time service.

1 call to RestClient::__construct()
RestClient::__construct in modules/salesforce_encrypt/src/Rest/RestClient.php
Construct a new Encrypted Rest Client.
1 method overrides RestClient::__construct()
RestClient::__construct in modules/salesforce_encrypt/src/Rest/RestClient.php
Construct a new Encrypted Rest Client.

File

src/Rest/RestClient.php, line 122

Class

RestClient
Objects, properties, and methods to communicate with the Salesforce REST API.

Namespace

Drupal\salesforce\Rest

Code

public function __construct(ClientInterface $http_client, ConfigFactoryInterface $config_factory, StateInterface $state, CacheBackendInterface $cache, Json $json, TimeInterface $time) {
  $this->configFactory = $config_factory;
  $this->httpClient = $http_client;
  $this->mutableConfig = $this->configFactory
    ->getEditable('salesforce.settings');
  $this->immutableConfig = $this->configFactory
    ->get('salesforce.settings');
  $this->state = $state;
  $this->cache = $cache;
  $this->json = $json;
  $this->time = $time;
  $this->httpClientOptions = [];
  return $this;
}