You are here

public function SocialApi::setToken in Social API 8.2

Same name and namespace in other branches
  1. 3.x src/Entity/SocialApi.php \Drupal\social_api\Entity\SocialApi::setToken()

Sets the encrypted, serialized token.

Parameters

string $token: The serialized access token.

Return value

\Drupal\social_auth\Entity\SocialApi Drupal Social Auth Entity.

File

src/Entity/SocialApi.php, line 58

Class

SocialApi
Defines a base class for Social API content entities.

Namespace

Drupal\social_api\Entity

Code

public function setToken($token) {
  $this
    ->set('token', $this
    ->encryptToken($token));
  return $this;
}