| @@ 60-70 (lines=11) @@ | ||
| 57 | * |
|
| 58 | * @return array |
|
| 59 | */ |
|
| 60 | public function getQuestions($sql = null, $params = null) |
|
| 61 | { |
|
| 62 | if ($sql == null) { |
|
| 63 | $questions = $this->findAll(); |
|
| 64 | } |
|
| 65 | if ($sql != null) { |
|
| 66 | $questions = $this->findAllWhere($sql, $params); |
|
| 67 | } |
|
| 68 | // array_reverse so latest order question gets returned |
|
| 69 | return array_map(array($this, 'setupQuestion'), $questions); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * Returns one question with it's own question text and other answers |
|
| @@ 56-66 (lines=11) @@ | ||
| 53 | * |
|
| 54 | * @return array |
|
| 55 | */ |
|
| 56 | public function getAllUsers($sql = null, $params = null) |
|
| 57 | { |
|
| 58 | if ($sql == null) { |
|
| 59 | $users = $this->findAll(); |
|
| 60 | } |
|
| 61 | if ($sql != null) { |
|
| 62 | $users = $this->findAllWhere($sql, $params); |
|
| 63 | } |
|
| 64 | ||
| 65 | return array_map(array($this, 'setupUser'), $users); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * return question/answer, three attributes are set, comments connected to them is an array. |
|