Stash\Interfaces\ItemInterface::extend PHP Method

extend() public method

Extends the expiration on the current cached item. For some engines this can be faster than storing the item again.
public extend ( null $ttl = null ) : boolean
$ttl null
return boolean
    public function extend($ttl = null);

Usage Example

Example #1
0
 private function assertDisabledStash(\Stash\Interfaces\ItemInterface $item)
 {
     $this->assertFalse($item->set('true'), 'storeData returns false for disabled cache');
     $this->assertNull($item->get(), 'getData returns null for disabled cache');
     $this->assertFalse($item->clear(), 'clear returns false for disabled cache');
     $this->assertTrue($item->isMiss(), 'isMiss returns true for disabled cache');
     $this->assertFalse($item->extend(), 'extend returns false for disabled cache');
     $this->assertTrue($item->lock(100), 'lock returns true for disabled cache');
 }