1 | <?php |
||
12 | class attachments |
||
13 | { |
||
14 | /** @var \phpbb\auth\auth */ |
||
15 | protected $auth; |
||
16 | |||
17 | /** @var \phpbb\db\driver\driver_interface */ |
||
18 | protected $db; |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | * |
||
23 | * @param \phpbb\auth\auth $auth Auth object |
||
24 | * @param \phpbb\db\driver\driver_interface $db Database connection |
||
25 | */ |
||
26 | 6 | public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db) |
|
31 | |||
32 | /** |
||
33 | * Get attachments... |
||
34 | * |
||
35 | * @param int $forum_id |
||
36 | * @param array $attach_ids |
||
37 | * @param array $allowed_extensions |
||
38 | * @param int|bool $limit |
||
39 | * @param bool $exclude_in_message |
||
40 | * @param string $order_by |
||
41 | * @return array |
||
42 | */ |
||
43 | 6 | public function get_attachments($forum_id = 0, array $attach_ids, $allowed_extensions = array(), $limit = false, $exclude_in_message = true, $order_by = 'filetime DESC') |
|
61 | |||
62 | /** |
||
63 | * @param int $forum_id |
||
64 | * @return bool |
||
65 | */ |
||
66 | 6 | protected function user_can_download_attachments($forum_id) |
|
70 | |||
71 | /** |
||
72 | * @param array $attach_ids |
||
73 | * @param array $allowed_extensions |
||
74 | * @param bool $exclude_in_message |
||
75 | * @param string $order_by |
||
76 | * @return string |
||
77 | */ |
||
78 | 6 | protected function get_attachment_sql(array $attach_ids, array $allowed_extensions, $exclude_in_message, $order_by) |
|
87 | } |
||
88 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: