Horde_ActiveSync_SyncCache::getCollections PHP Method

getCollections() public method

Return all the collections in the syncCache.
public getCollections ( boolean $requireKey = true ) : array
$requireKey boolean If true, only return collections with an existing synckey in the cache. Otherwise return all collections.
return array
    public function getCollections($requireKey = true)
    {
        $collections = array();
        foreach ($this->_data['collections'] as $key => $collection) {
            if (!$requireKey || $requireKey && !empty($collection['lastsynckey'])) {
                $collection['id'] = $key;
                $collections[$key] = $collection;
            }
        }
        return $collections;
    }

Usage Example

Esempio n. 1
0
 /**
  * Force reset all collection's PINGABLE flag. Used to force client
  * to issue a non-empty PING request.
  *
  */
 public function resetPingCache()
 {
     $collections = $this->_cache->getCollections(false);
     foreach ($collections as $id => $collection) {
         $this->_logger->info(sprintf('UNSETTING collection %s (%s) PINGABLE flag.', $collection['serverid'], $id));
         $this->_cache->removePingableCollection($id);
     }
 }
All Usage Examples Of Horde_ActiveSync_SyncCache::getCollections