1 | <?php |
||
14 | class data extends query_builder |
||
15 | { |
||
16 | /** @var \phpbb\auth\auth */ |
||
17 | protected $auth; |
||
18 | |||
19 | /** @var \phpbb\config\config */ |
||
20 | protected $config; |
||
21 | |||
22 | /** @var \phpbb\content_visibility */ |
||
23 | protected $content_visibility; |
||
24 | |||
25 | /** @var \phpbb\db\driver\driver_interface */ |
||
26 | protected $db; |
||
27 | |||
28 | /** @var \phpbb\user */ |
||
29 | protected $user; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param \phpbb\auth\auth $auth Auth object |
||
35 | * @param \phpbb\config\config $config Config object |
||
36 | * @param \phpbb\content_visibility $content_visibility Content visibility |
||
37 | * @param \phpbb\db\driver\driver_interface $db Database connection |
||
38 | * @param \phpbb\user $user User object |
||
39 | * @param integer $cache_time Cache results for 3 hours by default |
||
40 | */ |
||
41 | 16 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\content_visibility $content_visibility, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $cache_time = 10800) |
|
51 | |||
52 | /** |
||
53 | * Get topic data |
||
54 | * |
||
55 | * @param mixed|false $limit |
||
56 | * @param int $start |
||
57 | * @return array |
||
58 | */ |
||
59 | 10 | public function get_topic_data($limit = false, $start = 0) |
|
77 | |||
78 | /** |
||
79 | * Get post data |
||
80 | * |
||
81 | * @param mixed|false $topic_first_or_last_post (first|last) |
||
82 | * @param array $post_ids |
||
83 | * @param bool|false $limit |
||
84 | * @param int $start |
||
85 | * @param array $sql_array |
||
86 | * @return array |
||
87 | */ |
||
88 | 3 | public function get_post_data($topic_first_or_last_post = false, $post_ids = array(), $limit = false, $start = 0, $sql_array = array()) |
|
122 | |||
123 | /** |
||
124 | * Get attachments... |
||
125 | * |
||
126 | * @param int $forum_id |
||
127 | * @return array |
||
128 | */ |
||
129 | public function get_attachments($forum_id) |
||
153 | |||
154 | /** |
||
155 | * Get topic tracking info |
||
156 | * |
||
157 | * @param int $forum_id |
||
158 | * @return array |
||
159 | */ |
||
160 | 4 | public function get_topic_tracking_info($forum_id = 0) |
|
171 | |||
172 | /** |
||
173 | * Returns an array of topic first post or last post ids |
||
174 | * |
||
175 | * @return array |
||
176 | */ |
||
177 | public function get_posters_info() |
||
195 | |||
196 | /** |
||
197 | * Returns an array of topic first post or last post ids |
||
198 | * |
||
199 | * @param string $first_or_last_post |
||
200 | * @return array |
||
201 | */ |
||
202 | 3 | public function get_topic_post_ids($first_or_last_post = 'first') |
|
206 | |||
207 | /** |
||
208 | * @param array $post_ids |
||
209 | * @param string $topic_first_or_last_post |
||
210 | * @return array |
||
211 | */ |
||
212 | 3 | private function _get_post_data_where(array $post_ids, $topic_first_or_last_post) |
|
230 | |||
231 | /** |
||
232 | * @return array |
||
233 | */ |
||
234 | 4 | private function _get_tracking_info() |
|
248 | |||
249 | /** |
||
250 | * @param string $function |
||
251 | * @return array |
||
252 | */ |
||
253 | 4 | private function _build_tracking_info($function) |
|
263 | |||
264 | /** |
||
265 | * @return bool |
||
266 | */ |
||
267 | 4 | private function _can_track_by_lastread() |
|
271 | |||
272 | /** |
||
273 | * @return bool |
||
274 | */ |
||
275 | private function _can_track_anonymous() |
||
279 | |||
280 | /** |
||
281 | * @param int $forum_id |
||
282 | * @return bool |
||
283 | */ |
||
284 | private function _attachments_allowed($forum_id) |
||
288 | } |
||
289 |