You are here

public function LinkExpiry::getLifetime in Preview Link 8

Calculates default lifetime of a preview link.

Return value

int Preview link in seconds.

File

src/LinkExpiry.php, line 42

Class

LinkExpiry
Calculates link expiry time.

Namespace

Drupal\preview_link

Code

public function getLifetime() {
  $days = $this->state
    ->get('preview_link_expiry_days', static::DEFAULT_EXPIRY_DAYS);
  return $days * 86400;
}