You are here

public function AccessToken::isExpired in Access unpublished 8

Indicates if a token is expired.

Return value

bool Expired or not.

Overrides AccessTokenInterface::isExpired

File

src/Entity/AccessToken.php, line 260

Class

AccessToken
Defines the Access token entity.

Namespace

Drupal\access_unpublished\Entity

Code

public function isExpired() {
  return $this
    ->get('expire')->value > 0 && $this
    ->get('expire')->value < \Drupal::time()
    ->getRequestTime();
}