You are here

public function PreviewLinkExpiry::getLifetime in Preview Link 2.0.x

Same name and namespace in other branches
  1. 2.x src/PreviewLinkExpiry.php \Drupal\preview_link\PreviewLinkExpiry::getLifetime()

Calculates default lifetime of a preview link.

Return value

int Preview link in seconds.

File

src/PreviewLinkExpiry.php, line 44

Class

PreviewLinkExpiry
Calculates link expiry time.

Namespace

Drupal\preview_link

Code

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