/** * Clears the current item cache. * * @access public * @return boolean */ public function cleanCache() { // Extract all the cache objects for the current item id $cache_query = $this->mrRootDb->execute('SELECT itemid' . ' FROM cache_items' . ' WHERE application=' . $this->mrRootDb->formatText('innowork-core') . ' AND itemid LIKE ' . $this->mrRootDb->formatText('itemtypesearch-' . $this->mItemType . '%')); // Delete the cached objects for the current item id while (!$cache_query->eof) { $cached_item = new \Innomatic\Datatransfer\Cache\CachedItem($this->mrRootDb, 'innowork-core', $cache_query->getFields('itemid')); $cached_item->destroy(); $cache_query->moveNext(); } $cache_query->free(); return true; }
/** * Removes the current AppCentral server from the servers list. * * @access public * @return void */ public function remove() { $result = false; if ($this->id) { if ($this->dataAccess->execute('DELETE FROM applications_repositories ' . 'WHERE id=' . $this->id)) { // Destroy the cache for this repository. $cachedItem = new \Innomatic\Datatransfer\Cache\CachedItem($this->dataAccess, 'appcentral-client', 'repositories-' . $this->id); $cachedItem->destroy(); $this->id = 0; $result = true; } } return $result; }
public function cleanCache() { $cache_query = $this->rootDA->execute('SELECT itemid' . ' FROM cache_items' . ' WHERE application=' . $this->rootDA->formatText('innowork-core') . ' AND itemid LIKE ' . $this->rootDA->formatText('itemtypesearch-' . $this->mItemType . '%')); while (!$cache_query->eof) { $cached_item = new \Innomatic\Datatransfer\Cache\CachedItem($this->rootDA, 'innowork-core', $cache_query->getFields('itemid')); $cached_item->destroy(); $cache_query->moveNext(); } $cache_query->free(); return true; }