delete() public method

Will attempt to remove specified keys from the user space cache.
public delete ( array $keys ) : boolean
$keys array Keys to uniquely identify the cached items.
return boolean `true` on successful delete, `false` otherwise.
Esempio n. 1
0
 public function testDeleteWithScope()
 {
     $adapter = new Redis(array('scope' => 'primary'));
     $this->_redis->set('primary:key1', 'test1', 60);
     $this->_redis->set('key1', 'test2', 60);
     $keys = array('key1');
     $expected = array('key1' => 'test1');
     $adapter->delete($keys);
     $result = (bool) $this->_redis->get('key1');
     $this->assertTrue($result);
     $result = $this->_redis->get('primary:key1');
     $this->assertFalse($result);
 }