private function _prepareMemcacheKeyCollection() { foreach ($this->configMemcacheKeys as $key => $configuration) { if ($this->keyCollection->has($key)) { throw MemcacheCollectionException::duplicateMemcacheKey($key); } if (!$this->_hasConfiguration('pattern', $configuration)) { throw MemcacheCollectionException::missingRequiredMemcacheKeyConfig($key, 'pattern'); } $memcacheKey = new MemcacheKey(); $memcacheKey->setPattern($configuration['pattern']); $namespaces = $this->_getConfiguration('namespaces', $configuration, array()); foreach ($namespaces as $eachNamespace) { if (!$this->namespaceCollection->has($eachNamespace)) { throw new MemcacheCollectionException("Invalid namespace {$eachNamespace} for memcache key {$key}"); } $memcacheKey->addNamespace($this->namespaceCollection->get($eachNamespace)); } // compile pattern regexpression to setup pattern variables $variables = $this->_setupMemcacheKeyVariables($memcacheKey->getPattern()); $memcacheKey->setVariables($variables); // add to collection $this->keyCollection->set($key, $memcacheKey); } }