| 1 | <?php |
||
| 30 | class Group { |
||
| 31 | use |
||
| 32 | CRUD_helpers, |
||
| 33 | Singleton, |
||
| 34 | Any; |
||
| 35 | protected $data_model = [ |
||
| 36 | 'id' => 'int:0', |
||
| 37 | 'title' => 'html', |
||
| 38 | 'description' => 'html' |
||
| 39 | ]; |
||
| 40 | protected $table = '[prefix]groups'; |
||
| 41 | /** |
||
| 42 | * @var Cache\Prefix |
||
| 43 | */ |
||
| 44 | protected $cache; |
||
| 45 | /** |
||
| 46 | * Returns database index |
||
| 47 | * |
||
| 48 | * @return int |
||
| 49 | */ |
||
| 50 | protected function cdb () { |
||
| 56 | /** |
||
| 57 | * Get group data |
||
| 58 | * |
||
| 59 | * @param int|int[] $id |
||
| 60 | * |
||
| 61 | * @return array|array[]|false |
||
| 62 | */ |
||
| 63 | function get ($id) { |
||
| 81 | /** |
||
| 82 | * Get array of all groups |
||
| 83 | * |
||
| 84 | * @return int[] |
||
| 85 | */ |
||
| 86 | function get_all () { |
||
| 94 | /** |
||
| 95 | * Add new group |
||
| 96 | * |
||
| 97 | * @param string $title |
||
| 98 | * @param string $description |
||
| 99 | * |
||
| 100 | * @return false|int |
||
|
1 ignored issue
–
show
|
|||
| 101 | */ |
||
| 102 | function add ($title, $description) { |
||
| 115 | /** |
||
| 116 | * Set group data |
||
| 117 | * |
||
| 118 | * @param int $id |
||
| 119 | * @param string $title |
||
| 120 | * @param string $description |
||
| 121 | * |
||
| 122 | * @return bool |
||
| 123 | */ |
||
| 124 | function set ($id, $title, $description) { |
||
| 136 | /** |
||
| 137 | * Delete group |
||
| 138 | * |
||
| 139 | * @param int|int[] $id |
||
| 140 | * |
||
| 141 | * @return bool |
||
| 142 | */ |
||
| 143 | function del ($id) { |
||
| 183 | /** |
||
| 184 | * Get group permissions |
||
| 185 | * |
||
| 186 | * @param int $group |
||
| 187 | * |
||
| 188 | * @return int[]|false |
||
| 189 | */ |
||
| 190 | function get_permissions ($group) { |
||
| 193 | /** |
||
| 194 | * Set group permissions |
||
| 195 | * |
||
| 196 | * @param array $data |
||
| 197 | * @param int $group |
||
| 198 | * |
||
| 199 | * @return bool |
||
| 200 | */ |
||
| 201 | function set_permissions ($data, $group) { |
||
| 204 | /** |
||
| 205 | * Delete all permissions of specified group |
||
| 206 | * |
||
| 207 | * @param int $group |
||
| 208 | * |
||
| 209 | * @return bool |
||
| 210 | */ |
||
| 211 | function del_permissions_all ($group) { |
||
| 214 | } |
||
| 215 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.