Línea 60... |
Línea 60... |
60 |
* @param string|null $wheresql Where conditions for the SQL
|
60 |
* @param string|null $wheresql Where conditions for the SQL
|
61 |
* @param string|null $sortsql Order by conditions for the SQL
|
61 |
* @param string|null $sortsql Order by conditions for the SQL
|
62 |
* @param int|null $userid The user ID
|
62 |
* @param int|null $userid The user ID
|
63 |
* @return string
|
63 |
* @return string
|
64 |
*/
|
64 |
*/
|
65 |
protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null): string {
|
65 |
protected function generate_get_records_sql(?string $wheresql = null, ?string $sortsql = null, ?int $userid = null): string {
|
66 |
$selectsql = 'SELECT * FROM {' . self::TABLE . '} ' . $this->get_table_alias();
|
66 |
$selectsql = 'SELECT * FROM {' . self::TABLE . '} ' . $this->get_table_alias();
|
67 |
$selectsql .= $wheresql ? ' WHERE ' . $wheresql : '';
|
67 |
$selectsql .= $wheresql ? ' WHERE ' . $wheresql : '';
|
68 |
$selectsql .= $sortsql ? ' ORDER BY ' . $sortsql : '';
|
68 |
$selectsql .= $sortsql ? ' ORDER BY ' . $sortsql : '';
|
Línea 69... |
Línea 69... |
69 |
|
69 |
|
Línea 91... |
Línea 91... |
91 |
* Get all discussions in the specified forum.
|
91 |
* Get all discussions in the specified forum.
|
92 |
*
|
92 |
*
|
93 |
* @param forum_entity $forum
|
93 |
* @param forum_entity $forum
|
94 |
* @return array
|
94 |
* @return array
|
95 |
*/
|
95 |
*/
|
96 |
public function get_all_discussions_in_forum(forum_entity $forum, string $sort = null): ?array {
|
96 |
public function get_all_discussions_in_forum(forum_entity $forum, ?string $sort = null): ?array {
|
97 |
global $USER;
|
97 |
global $USER;
|
98 |
$options = ['forum' => $forum->get_id()];
|
98 |
$options = ['forum' => $forum->get_id()];
|
Línea 99... |
Línea 99... |
99 |
|
99 |
|
100 |
$managerfactory = container::get_manager_factory();
|
100 |
$managerfactory = container::get_manager_factory();
|