/** * Gets forecast as Weather Object * * @param mixed (integer|string) $city * @param int $days * @return Array Weather Object */ public function getForecastObject($city, $days = 3) { // Cheking if cache is enabled if ($this->container->getParameter('pianosolo.weather.options.cache') === TRUE) { $cacheID = $city . $days . 'fcO'; if (!($weathers = $this->getCache($cacheID))) { $weathers = $this->weatherService->getForecastObject($city, $days); $this->saveCache($cacheID, $weathers); } } else { $weathers = $this->weatherService->getForecastObject($city, $days); } return $weathers; }
/** * Gets forecast as Weather Object * * @param mixed (integer|string) $city * @param int $days * @return array Weather Object */ public function getForecastObject($city, $days = 3) { // Checking if cache is enabled if ($this->cacheIsEnabled) { $cacheID = $city . $days . 'fcO'; if (!($weathers = $this->getCache($cacheID))) { $weathers = $this->weatherService->getForecastObject($city, $days); $this->saveCache($cacheID, $weathers); } } else { $weathers = $this->weatherService->getForecastObject($city, $days); } return $weathers; }