/** * Get data by type from the cache * * @return array * @param string $type The type of data to get. * @param int $startTimestamp The start timestamp for the cache file. * @param int $endTimestamp The end timestamp for the cache file. */ public static function getDataFromCacheByType($type, $startTimestamp, $endTimestamp) { // doesnt exist in cache if (!isset(self::$data[$type])) { // load cache xml file self::$data = self::getCacheFile($startTimestamp, $endTimestamp); // doesnt exist in cache after loading the xml file so set to false to get live data if (!isset(self::$data[$type])) { return false; } } // return data return isset(self::$data[$type]['entries']) ? self::$data[$type]['entries'] : self::$data[$type]; }