public static function fillDataRoot($dataroot, $request) { //detect whether from was an id and change from accordingly $from = $request->getFrom(); if (sizeof(explode(".", $request->getFrom())) > 1) { $from = stations::getStationFromID($request->getFrom(), $request->getLang()); $from = $from->name; } $to = $request->getTo(); if (sizeof(explode(".", $request->getTo())) > 1) { $to = stations::getStationFromID($request->getTo(), $request->getLang()); $to = $to->name; } $dataroot->connection = connections::scrapeConnections($from, $to, $request->getTime(), $request->getDate(), $request->getResults(), $request->getLang(), $request->getTimeSel(), $request->getTypeOfTransport()); }