public function setExpiresIn(DateInterval $interval)
    {
        $now = new DateTimeImmutable();
        $expire = $now->add($interval);
        $this->setExpiresInSeconds($expire->getTimestamp() - $now->getTimestamp());
        return $this;
    }
public function setExpiresIn(DateInterval $interval)
    {
        $now = new DateTimeImmutable();
        $expire = $now->add($interval);
        $this->setExpiresInSeconds($expire->getTimestamp() - $now->getTimestamp());
        return $this;
    }
public function setExpiresIn ( DateInterval $ interval ) { $ now = new DateTimeImmutable ( ) ; $ expire = $ now -> add ( $ interval ) ; $ this -> setExpiresInSeconds ( $ expire -> getTimestamp ( ) - $ now -> getTimestamp ( ) ) ; return $ this ; }
Set the time until the cache should expire.
@param DateInterval $interval In what time the cache should expire.
@return CachePolicy Provides fluent interface
Set the time until the cache should expire .