You are here

protected function RestfulTokenAuthController::getExpireTime in RESTful 7

Return the expiration time.

Return value

int Timestamp with the expiration time.

Throws

RestfulServerConfigurationException

1 call to RestfulTokenAuthController::getExpireTime()
RestfulTokenAuthController::generateAccessToken in modules/restful_token_auth/includes/RestfulTokenAuthController.php
Create a new access_token entity with a referenced refresh_token.

File

modules/restful_token_auth/includes/RestfulTokenAuthController.php, line 89
Contains \RestfulTokenAuthController

Class

RestfulTokenAuthController
@file Contains \RestfulTokenAuthController

Code

protected function getExpireTime() {
  $now = new \DateTime();
  try {
    $expiration = $now
      ->add(new \DateInterval(variable_get('restful_token_auth_expiration_period', 'P1D')));
  } catch (\Exception $e) {
    throw new \RestfulServerConfigurationException('Invalid DateInterval format provided.');
  }
  return $expiration
    ->format('U');
}