Cachearium\CacheAbstract::clean PHP Method

clean() public method

Cleans cache: all entries with a certain $base and $id in the $key are deleted.
public clean ( CacheKey $k ) : boolean
$k CacheKey
return boolean true if no problem
    public function clean(CacheKey $k)
    {
        return $this->cleanP($k->getBase(), $k->getId());
    }

Usage Example

 protected function _startcallback(CacheAbstract $cache)
 {
     $key = new CacheKey("startcallback", 1);
     $cache->clean($key);
     $this->assertFalse($cache->start($key));
     echo "something ";
     $this->assertTrue($cache->appendCallback('callbackTesterStart'));
     echo " otherthing";
     $output = $cache->end(false);
     $this->assertContains(CALLBACKVALUE, $output);
     // run again, we should have another value
     $second = $cache->start($key, null, false);
     $this->assertNotFalse($second);
     $this->assertContains(CALLBACKVALUE, $second);
     $this->assertNotEquals($second, $output);
 }
All Usage Examples Of Cachearium\CacheAbstract::clean