public function testSetGet()
 {
     $map = new ObjectMap();
     $stack = new \stdClass();
     $map->set('MyStack', $stack);
     $this->assertSame($stack, $map->get('MyStack'));
 }
Exemple #2
0
 /**
  * Adds a named cache for using with addLayer
  *
  * @static
  * @param string $name
  * @param \LayerCache\Cache\CachingLayer $cache
  */
 public static function registerCache($name, CachingLayer $cache)
 {
     if (self::$cacheMap === null) {
         self::$cacheMap = new ObjectMap();
     }
     self::$cacheMap->set($name, $cache);
 }
Exemple #3
0
 /**
  * Creates a stack from the specification and adds it to the cache stack registry
  *
  * @param  string $name
  * @return \LayerCache\Stack
  */
 public function toStack($name)
 {
     $stack = $this->createStack($this->dataSource, $this->keySource, $this->layers);
     $this->stackMap->set($name, $stack);
     return $stack;
 }