You are here

public function RestfulBase::getAccount in RESTful 7

Proxy method to get the account from the authenticationManager.

Parameters

boolean $cache: Boolean indicating if the resolved user should be cached for next calls.

Return value

\stdClass The user object.

19 calls to RestfulBase::getAccount()
RestfulAccessTokenAuthentication::getOrCreateToken in modules/restful_token_auth/plugins/restful/restful_token_auth/token_auth/access_token/1.0/RestfulAccessTokenAuthentication.class.php
Create a token for a user, and return its value.
RestfulBase::addExtraInfoToQuery in plugins/restful/RestfulBase.php
Adds query tags and metadata to the EntityFieldQuery.
RestfulBase::generateCacheId in plugins/restful/RestfulBase.php
Generate a cache identifier for the request and the current context.
RestfulCsrfTokenResource::access in plugins/restful/csrf/RestfulCsrfTokenResource.class.php
Overrides RestfulBase::access().
RestfulDataProviderDbQuery::addExtraInfoToQuery in plugins/restful/RestfulDataProviderDbQuery.php
Adds query tags and metadata to the EntityFieldQuery.

... See full list

File

plugins/restful/RestfulBase.php, line 1169
Contains RestfulBase.

Class

RestfulBase
Class \RestfulBase

Code

public function getAccount($cache = TRUE) {

  // The request.
  $request = $this
    ->getRequest();

  // The HTTP method. Defaults to "get".
  $method = $this
    ->getMethod();
  $account = $this
    ->getAuthenticationManager()
    ->getAccount($request, $method, $cache);

  // If the limit rate is enabled for the current plugin then set the account.
  if ($this
    ->getRateLimitManager()) {
    $this
      ->getRateLimitManager()
      ->setAccount($account);
  }
  return $account;
}