public function removeCollection($id, $purge = true) { if ($purge) { $this->_logger->info(sprintf('[%s] Removing collection %s from SyncCache.', $this->_procid, $id)); unset($this->_data['collections'][$id]); $this->_dirty['collections'] = true; } elseif (!empty($this->_data['collections'][$id])) { $this->_data['collections'][$id]['synckey'] = '0'; $this->_markCollectionsDirty($id); } }
/** * Check for an update FILTERTYPE * * @param string $id The collection id to check * @param string $filter The new filter value. * * @return boolean True if filtertype passed, false if it has changed. */ public function checkFilterType($id, $filter) { $cc = $this->_cache->getCollections(); if (!empty($cc[$id]['filtertype']) && !is_null($filter) && $cc[$id]['filtertype'] != $filter) { $this->_cache->removeCollection($id, true); $this->_cache->save(); $this->_logger->info('Invalidating SYNCKEY and removing collection - found updated filtertype'); return false; } return true; }