public function getBlogById($blogId) { $cacheKey = "getBlogById_" . $blogId . ".gb"; $blogObj = $this->gbReadCache($cacheKey); if ($blogObj === false) { foreach ($this->blogs as $idx => $blog) { if ($blog['blogId'] == $blogId) { $blogObj = $blog; $this->gbWriteCache($cacheKey, $blogObj); break; } } } return $blogObj; }