src/Comment/Modules/Question.php 1 location
|
@@ 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 |
src/Comment/Modules/User.php 1 location
|
@@ 106-116 (lines=11) @@
|
| 103 |
|
* |
| 104 |
|
* @return array |
| 105 |
|
*/ |
| 106 |
|
public function getAllUsers($sql = null, $params = null) |
| 107 |
|
{ |
| 108 |
|
if ($sql == null) { |
| 109 |
|
$users = $this->findAll(); |
| 110 |
|
} |
| 111 |
|
if ($sql != null) { |
| 112 |
|
$users = $this->findAllWhere($sql, $params); |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
return array_map(array($this, 'setupUser'), $users); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
/** |
| 119 |
|
* return question/answer, three attributes are set, comments connected to them is an array. |