getVersion(); if (Comparator::lessThanOrEqualTo($objVersion, $compareVersion)) { if (array_key_exists($obj->getId(), $data)) { $existingVersion = $data[$obj->getId()]->getVersion(); if (Comparator::greaterThan($objVersion, $existingVersion)) { $data[$obj->getId()] = $obj; } } else { $data[$obj->getId()] = $obj; } } } return $data; } /* Get a specific CompatGame-object for the requested version. */ public static function getGameData($version, $target) { if (!is_string($version) || !is_string($target)) { throw new \ErrorException(self::NO_VERSION_TARGET); } if (!($all_games = self::getAllData($version))) { throw new \ErrorException(self::NOT_FOUND); } if (!array_key_exists($target, $all_games)) { throw new \ErrorException(self::NOT_FOUND); } return $all_games[$target]; } }