Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\groupposition; |
15 | |
16 | /** |
17 | * Interface to manage group positions in various places of phpbb |
18 | * |
19 | * The interface provides simple methods to add, delete and move a group |
20 | */ |
21 | interface groupposition_interface |
22 | { |
23 | /** |
24 | * Returns the value for a given group, if the group exists. |
25 | * @param int $group_id group_id of the group to be selected |
26 | * @return int position of the group |
27 | */ |
28 | public function get_group_value($group_id); |
29 | |
30 | /** |
31 | * Get number of groups displayed |
32 | * |
33 | * @return int value of the last item displayed |
34 | */ |
35 | public function get_group_count(); |
36 | |
37 | /** |
38 | * Addes a group by group_id |
39 | * |
40 | * @param int $group_id group_id of the group to be added |
41 | * @return bool True if the group was added successfully |
42 | */ |
43 | public function add_group($group_id); |
44 | |
45 | /** |
46 | * Deletes a group by group_id |
47 | * |
48 | * @param int $group_id group_id of the group to be deleted |
49 | * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway. |
50 | * @return bool True if the group was deleted successfully |
51 | */ |
52 | public function delete_group($group_id, $skip_group = false); |
53 | |
54 | /** |
55 | * Moves a group up by group_id |
56 | * |
57 | * @param int $group_id group_id of the group to be moved |
58 | * @return bool True if the group was moved successfully |
59 | */ |
60 | public function move_up($group_id); |
61 | |
62 | /** |
63 | * Moves a group down by group_id |
64 | * |
65 | * @param int $group_id group_id of the group to be moved |
66 | * @return bool True if the group was moved successfully |
67 | */ |
68 | public function move_down($group_id); |
69 | |
70 | /** |
71 | * Moves a group up/down |
72 | * |
73 | * @param int $group_id group_id of the group to be moved |
74 | * @param int $delta number of steps: |
75 | * - positive = move up |
76 | * - negative = move down |
77 | * @return bool True if the group was moved successfully |
78 | */ |
79 | public function move($group_id, $delta); |
80 | } |