public function getBlogByYearMonthId($yearMonthId) { $cacheKey = "getBlogByYearMonthId_" . $yearMonthId . ".gb"; $blogList = $this->gbReadCache($cacheKey); if ($blogList === false) { $blogList = array(); foreach ($this->blogs as $idx => $blog) { $_yearMonthId = date("Ym", strtotime($blog['date'])); if ($yearMonthId == $_yearMonthId) { array_push($blogList, $blog); } } $this->gbWriteCache($cacheKey, $blogList); } return $blogList; }