1 | <?php |
||
12 | class data extends query_builder |
||
13 | { |
||
14 | /** @var \phpbb\auth\auth */ |
||
15 | protected $auth; |
||
16 | |||
17 | /** @var \phpbb\config\config */ |
||
18 | protected $config; |
||
19 | |||
20 | /** @var \phpbb\content_visibility */ |
||
21 | protected $content_visibility; |
||
22 | |||
23 | /** @var \phpbb\db\driver\driver_interface */ |
||
24 | protected $db; |
||
25 | |||
26 | /** @var \phpbb\user */ |
||
27 | protected $user; |
||
28 | |||
29 | /** @var \blitze\sitemaker\services\users\data */ |
||
30 | protected $user_data; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param \phpbb\auth\auth $auth Auth object |
||
36 | * @param \phpbb\config\config $config Config object |
||
37 | * @param \phpbb\content_visibility $content_visibility Content visibility |
||
38 | * @param \phpbb\db\driver\driver_interface $db Database connection |
||
39 | * @param \phpbb\user $user User object |
||
40 | * @param \blitze\sitemaker\services\users\data $user_data Sitemaker User data object |
||
41 | * @param integer $cache_time Cache results for 3 hours by default |
||
42 | */ |
||
43 | 31 | 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, \blitze\sitemaker\services\users\data $user_data, $cache_time) |
|
54 | |||
55 | /** |
||
56 | * Get topics count |
||
57 | * |
||
58 | * @return integer |
||
59 | */ |
||
60 | 1 | public function get_topics_count() |
|
74 | |||
75 | /** |
||
76 | * Get topic data |
||
77 | * |
||
78 | * @param int|false $limit |
||
79 | * @param int $start |
||
80 | * @return array |
||
81 | */ |
||
82 | 13 | public function get_topic_data($limit = false, $start = 0) |
|
105 | |||
106 | /** |
||
107 | * Get post data |
||
108 | * |
||
109 | * @param mixed|false $topic_first_or_last_post (first|last) |
||
110 | * @param array $post_ids |
||
111 | * @param bool|false $limit |
||
112 | * @param int $start |
||
113 | * @param array $sql_array |
||
114 | * @return array |
||
115 | */ |
||
116 | 11 | public function get_post_data($topic_first_or_last_post = false, $post_ids = array(), $limit = false, $start = 0, $sql_array = array()) |
|
140 | |||
141 | /** |
||
142 | * Get attachments... |
||
143 | * |
||
144 | * @param int $forum_id |
||
145 | * @param array $allowed_extensions |
||
146 | * @param mixed|bool $limit |
||
147 | * @param bool $exclude_in_message |
||
148 | * @param string $order_by |
||
149 | * @return array |
||
150 | */ |
||
151 | 8 | public function get_attachments($forum_id = 0, $allowed_extensions = array(), $limit = false, $exclude_in_message = true, $order_by = 'filetime DESC') |
|
162 | |||
163 | /** |
||
164 | * Get topic tracking info |
||
165 | * |
||
166 | * @param int $forum_id |
||
167 | * @return array |
||
168 | */ |
||
169 | 6 | public function get_topic_tracking_info($forum_id = 0) |
|
180 | |||
181 | /** |
||
182 | * Returns an array of topic first post or last post ids |
||
183 | * |
||
184 | * @param string $first_or_last_post |
||
185 | * @return array |
||
186 | */ |
||
187 | 3 | public function get_topic_post_ids($first_or_last_post = 'first') |
|
191 | |||
192 | /** |
||
193 | * Returns an array of topic first post or last post ids |
||
194 | */ |
||
195 | 6 | public function get_posters_info() |
|
207 | |||
208 | /** |
||
209 | * @param mixed $topic_first_or_last_post |
||
210 | * @param array $post_ids |
||
211 | * @param array $sql_array |
||
212 | * @return array |
||
213 | */ |
||
214 | 11 | private function _get_posts_sql_array($topic_first_or_last_post, array $post_ids, array $sql_array) |
|
231 | |||
232 | /** |
||
233 | * @param array $post_ids |
||
234 | * @param string $topic_first_or_last_post |
||
235 | * @return array |
||
236 | */ |
||
237 | 11 | private function _get_post_data_where(array $post_ids, $topic_first_or_last_post) |
|
254 | |||
255 | /** |
||
256 | * @param array $sql_where |
||
257 | * @param string $topic_first_or_last_post |
||
258 | */ |
||
259 | 3 | private function _limit_posts_by_topic(array &$sql_where, $topic_first_or_last_post) |
|
268 | } |
||
269 |