Horde_ActiveSync_SyncCache::removeCollection PHP Method

removeCollection() public method

Remove a collection from the cache.
public removeCollection ( string $id, boolean $purge = true )
$id string The collection id.
$purge boolean If true, completely remove the collection entry otherwise, just resets the synckey.
    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);
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * 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;
 }
All Usage Examples Of Horde_ActiveSync_SyncCache::removeCollection