Nette\Caching\Storages\SQLiteStorage::clean PHP Method

clean() public method

Removes items from the cache by conditions & garbage collector.
public clean ( array $conditions ) : void
$conditions array
return void
    public function clean(array $conditions)
    {
        if (!empty($conditions[Cache::ALL])) {
            $this->pdo->prepare('DELETE FROM cache')->execute();
        } else {
            $sql = 'DELETE FROM cache WHERE expire < ?';
            $args = [time()];
            if (!empty($conditions[Cache::TAGS])) {
                $tags = (array) $conditions[Cache::TAGS];
                $sql .= ' OR key IN (SELECT key FROM tags WHERE tag IN (?' . str_repeat(',?', count($tags) - 1) . '))';
                $args = array_merge($args, $tags);
            }
            $this->pdo->prepare($sql)->execute($args);
        }
    }