CampCache::singleton PHP Method

singleton() public static method

Singleton function that returns the global class object.
public static singleton ( ) : CampCache
return CampCache
    public static function singleton()
    {
        if (is_null(self::$m_instance)) {
            $preferencesService = \Zend_Registry::get('container')->getService('system_preferences_service');
            self::$m_instance = new CampCache($preferencesService->DBCacheEngine);
        }
        return self::$m_instance;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Get cache object
  * @return CampCache
  */
 public function getCache()
 {
     if ($this->cache === NULL) {
         $this->cache = CampCache::singleton();
     }
     return $this->cache;
 }
All Usage Examples Of CampCache::singleton