src/Comment/Modules/Question.php 1 location
|
@@ 59-71 (lines=13) @@
|
56 |
|
* |
57 |
|
* @return array |
58 |
|
*/ |
59 |
|
public function getQuestions($sql = null, $params = null) |
60 |
|
{ |
61 |
|
$questions = []; |
62 |
|
|
63 |
|
if ($sql == null) { |
64 |
|
$questions = $this->findAll(); |
65 |
|
} |
66 |
|
if ($sql != null) { |
67 |
|
$questions = $this->findAllWhere($sql, $params); |
68 |
|
} |
69 |
|
// array_reverse so latest order question gets returned |
70 |
|
return array_reverse(array_map(array($this, 'setupQuestion'), $questions)); |
71 |
|
} |
72 |
|
|
73 |
|
/** |
74 |
|
* Returns one question with it's own question text and other answers |
src/Comment/Modules/User.php 1 location
|
@@ 108-118 (lines=11) @@
|
105 |
|
* |
106 |
|
* @return array |
107 |
|
*/ |
108 |
|
public function getAllUsers($sql = null, $params = null) |
109 |
|
{ |
110 |
|
if ($sql == null) { |
111 |
|
$users = $this->findAll(); |
112 |
|
} |
113 |
|
if ($sql != null) { |
114 |
|
$users = $this->findAllWhere($sql, $params); |
115 |
|
} |
116 |
|
|
117 |
|
return array_map(array($this, 'setupUser'), $users); |
118 |
|
} |
119 |
|
|
120 |
|
/** |
121 |
|
* return question/answer, three attributes are set, comments connected to them is an array. |