public function retrieve($class_name, $id) { if (!$this->exists($class_name, $id)) { throw new NotFoundException('Entity ' . $class_name . ':' . $id . ' does not exist in cache'); } return $this->storage[$this->getEntityKey($class_name, $id)]; }