You are here

public static function TokenAuthenticationBase::getTokenFromEntity in RESTful 7.2

Get the token string from the token entity.

Parameters

int $token_id: The restful_token_auth entity.

Return value

string The token string.

File

modules/restful_token_auth/src/Plugin/resource/TokenAuthenticationBase.php, line 70
Contains Drupal\restful_token_auth\Plugin\resource\TokenAuthenticationBase.

Class

TokenAuthenticationBase

Namespace

Drupal\restful_token_auth\Plugin\resource

Code

public static function getTokenFromEntity($token_id) {
  if ($token = entity_load_single('restful_token_auth', $token_id)) {
    return $token->token;
  }
  return NULL;
}