/** * @throws \Exception * @throws \Predis\Connection\ConnectionException */ public function fire() { try { $this->analytics->getDisableKey(); $this->info("cleanup for Redis key"); } catch (\Predis\Connection\ConnectionException $error) { throw $error; } }
/** * @access private * @return mixed */ private function getContentsRanking() { $result = $this->analytics->getSortedCount(0, 6); if ($result) { foreach ($result as $row) { $recipe = $this->recipe->getRecipe($row->recipe_id); $category = $this->category->getCategory($recipe->category_id); $row->category_id = isset($recipe->category_id) ? $recipe->category_id : null; $row->title = isset($recipe->title) ? $recipe->title : null; $row->name = isset($category->name) ? $category->name : null; } } return $result; }