You are here

public function ParsedMarkdown::getExpire in Markdown 8.2

Retrieves the UNIX timestamp for when this object should expire.

Note: this method should handle the use case of a string being set to indicate a relative future time.

Parameters

int $from_time: A UNIX timestamp used to expire from. This will only be used when the expire value has been set to a relative time in the future, e.g. day, week, month, etc. If not set, this current request time will be used.

Return value

int The UNIX timestamp.

Overrides ParsedMarkdownInterface::getExpire

File

src/Render/ParsedMarkdown.php, line 106

Class

ParsedMarkdown
The end result of parsing markdown into HTML.

Namespace

Drupal\markdown\Render

Code

public function getExpire($from_time = NULL) {
  $expire = $this->expire;

  // Handle relative time.
  if (is_string($expire)) {
    $expire = strtotime($expire, $from_time ?: REQUEST_TIME);
  }
  return $expire;
}