public static function getStationFromName($name, $lang) { stations::fetchAllStationsFromDB("EN"); $i = 0; while ($i < sizeof(stations::$stations) && stations::$stations[$i]->name != $name) { $i++; } if (stations::$stations[$i]->name == $name) { return stations::$stations[$i]; } //otherwise search for other method: Hafas? return null; }
public static function fillDataRoot($dataroot, $request) { $dataroot->station = stations::fetchAllStationsFromDB($request->getLang()); }