Stash\Item::clear PHP Method

clear() public method

public clear ( )
    public function clear()
    {
        try {
            return $this->executeClear();
        } catch (Exception $e) {
            $this->logException('Clearing cache caused exception.', $e);
            $this->disable();
            return false;
        }
    }

Usage Example

Example #1
0
 public function testClear()
 {
     $item = new Item();
     $poolStub = new PoolGetDriverStub();
     $poolStub->setDriver(new DriverExceptionStub());
     $item->setPool($poolStub);
     $item->setKey(array('path', 'to', 'clear'));
     $this->assertFalse($item->isDisabled());
     $this->assertFalse($item->clear());
     $this->assertTrue($item->isDisabled(), 'Is disabled after exception is thrown in driver');
 }
All Usage Examples Of Stash\Item::clear