getId() == $id) { return $dbo; } } return null; } public static function mergeStringArray(array $array1, array $array2) { foreach ($array2 as $e) { if (!in_array($e, $array1)) { $array1[] = $e; } } return $array1; } public static function getAll() { $config = MiscBusiness::getConfig(); $dbos = []; foreach ($config["scheduleTypes"] as $scheduleType) { $scheduleDbos = static::getDataAccess()->getAll($scheduleType["resourceId"], $scheduleType["type"]); foreach ($scheduleDbos as $scheduleDbo) { $dbo = static::getStopDboById($dbos, $scheduleDbo->getId()); if (is_null($dbo)) { $dbos[] = $scheduleDbo; } else { $dbo->setRoutes(static::mergeStringArray($dbo->getRoutes(), $dbo->getRoutes())); } } } return new LuPaginatedDbo(count($dbos), $dbos); } }