Neos\Cache\Backend\AbstractBackend::calculateExpiryTime PHP Method

calculateExpiryTime() protected method

Calculates the expiry time by the given lifetime. If no lifetime is specified, the default lifetime is used.
protected calculateExpiryTime ( integer $lifetime = null ) : DateTime
$lifetime integer The lifetime in seconds
return DateTime The expiry time
    protected function calculateExpiryTime($lifetime = null)
    {
        if ($lifetime === self::UNLIMITED_LIFETIME || $lifetime === null && $this->defaultLifetime === self::UNLIMITED_LIFETIME) {
            $expiryTime = new \DateTime(self::DATETIME_EXPIRYTIME_UNLIMITED, new \DateTimeZone('UTC'));
        } else {
            if ($lifetime === null) {
                $lifetime = $this->defaultLifetime;
            }
            $expiryTime = new \DateTime('now +' . $lifetime . ' seconds', new \DateTimeZone('UTC'));
        }
        return $expiryTime;
    }