public function flush() { foreach ($this->objects as $className => $objects) { $this->cache->setNamespace($className); $this->cache->saveMultiple($objects); } }
/** * @param array $criteria * * @return object[] */ public function findOneBy(array $criteria) { $this->cache->setNamespace($this->className); $id = $this->getId($criteria); return $this->cache->fetch($id); }