You are here

public function RestClient::setAccessToken in Salesforce Suite 8.3

Same name in this branch
  1. 8.3 src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::setAccessToken()
  2. 8.3 modules/salesforce_encrypt/src/Rest/RestClient.php \Drupal\salesforce_encrypt\Rest\RestClient::setAccessToken()

Set the access token.

Parameters

string $token: Access token from Salesforce.

Overrides RestClientInterface::setAccessToken

Deprecated

in 8.x-4.0 and does not have an exact analog, refer to \Drupal\salesforce\SalesforceAuthProviderInterface instead.

1 call to RestClient::setAccessToken()
RestClient::setAccessToken in modules/salesforce_encrypt/src/Rest/RestClient.php
Set the access token.
1 method overrides RestClient::setAccessToken()
RestClient::setAccessToken in modules/salesforce_encrypt/src/Rest/RestClient.php
Set the access token.

File

src/Rest/RestClient.php, line 463

Class

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

Namespace

Drupal\salesforce\Rest

Code

public function setAccessToken($token) {
  $this->state
    ->set('salesforce.access_token', $token);
  $this
    ->storage()
    ->updateToken();
  return $this;
}