/** * {@inheritDoc} */ public function getNamespaces() { if (empty($this->namespaces)) { $cacheKey = 'namespaces'; $result = $this->caches['meta']->fetch($cacheKey); if ($result) { $this->namespaces = $result; } else { $this->namespaces = parent::getNamespaces(); $this->caches['meta']->save($cacheKey, $this->namespaces); } } return $this->namespaces; }
/** * {@inheritDoc} */ public function getNamespaces() { if ($this->namespaces instanceof \ArrayObject) { return parent::getNamespaces(); } $cacheKey = 'namespaces'; $cacheKey = $this->sanitizeKey($cacheKey); $result = $this->caches['meta']->fetch($cacheKey); if ($result) { $this->setNamespaces($result); } else { $result = parent::getNamespaces(); $this->caches['meta']->save($cacheKey, $result); } return $result; }