private function getAllLeagues() { $leagues = array(); $result = db_select('league', 'l')->fields('l')->orderBy('sequence')->orderBy('name')->execute(); while ($record = $result->fetchAssoc()) { $updateLeague = new League($record['leagueid'], $record['sequence'], $record['name']); $updateLeague->setSavedDateTimeAndUser($record['saved_datetime'], $record['saved_userid']); array_push($leagues, $updateLeague); } return $leagues; }