Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Helper class to load stuff |
---|
5 | * |
---|
6 | * @author fpvanagthoven |
---|
7 | */ |
---|
8 | class Loader { |
---|
9 | |
---|
10 | /** |
---|
11 | * |
---|
12 | * @return array Array of Surveys with id and title |
---|
13 | */ |
---|
14 | public static function loadSurveys() { |
---|
15 | $surveys = array(); |
---|
16 | |
---|
17 | $surveyDBI = new SurveyDatabaseInterface(null); |
---|
18 | $surveyIDTitles = $surveyDBI->getExistingSurveys(); |
---|
19 | |
---|
20 | foreach ($surveyIDTitles as $id => $title) { |
---|
21 | $survey = new Survey($id, $title); |
---|
22 | array_push($surveys, $survey); |
---|
23 | } |
---|
24 | |
---|
25 | return $surveys; |
---|
26 | } |
---|
27 | |
---|
28 | } |
---|
29 | |
---|
30 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.