| 1 | <?php |
||
| 21 | class Sections { |
||
| 22 | use |
||
| 23 | CRUD_helpers, |
||
| 24 | Singleton; |
||
| 25 | |||
| 26 | protected $data_model = [ |
||
| 27 | 'id' => 'int:0', |
||
| 28 | 'parent' => 'int:0', |
||
| 29 | 'title' => 'ml:text', |
||
| 30 | 'path' => 'ml:text' |
||
| 31 | ]; |
||
| 32 | protected $table = '[prefix]blogs_sections'; |
||
| 33 | protected $data_model_ml_group = 'Blogs/sections'; |
||
| 34 | /** |
||
| 35 | * @var Cache\Prefix |
||
| 36 | */ |
||
| 37 | protected $cache; |
||
| 38 | |||
| 39 | protected function construct () { |
||
| 42 | /** |
||
| 43 | * Returns database index |
||
| 44 | * |
||
| 45 | * @return int |
||
| 46 | */ |
||
| 47 | protected function cdb () { |
||
| 50 | /** |
||
| 51 | * Get data of specified section |
||
| 52 | * |
||
| 53 | * @param int|int[] $id |
||
| 54 | * |
||
| 55 | * @return array|false |
||
| 56 | */ |
||
| 57 | function get ($id) { |
||
| 88 | /** |
||
| 89 | * @return array[] |
||
| 90 | */ |
||
| 91 | function get_all () { |
||
| 109 | /** |
||
| 110 | * Get sections ids for each section in full path |
||
| 111 | * |
||
| 112 | * @param string|string[] $path |
||
| 113 | * |
||
| 114 | * @return false|int[] |
||
|
1 ignored issue
–
show
|
|||
| 115 | */ |
||
| 116 | function get_by_path ($path) { |
||
| 136 | /** |
||
| 137 | * Add new section |
||
| 138 | * |
||
| 139 | * @param int $parent |
||
| 140 | * @param string $title |
||
| 141 | * @param string $path |
||
| 142 | * |
||
| 143 | * @return false|int Id of created section on success of <b>false</> on failure |
||
| 144 | */ |
||
| 145 | function add ($parent, $title, $path) { |
||
| 161 | /** |
||
| 162 | * Set data of specified section |
||
| 163 | * |
||
| 164 | * @param int $id |
||
| 165 | * @param int $parent |
||
| 166 | * @param string $title |
||
| 167 | * @param string $path |
||
| 168 | * |
||
| 169 | * @return bool |
||
| 170 | */ |
||
| 171 | function set ($id, $parent, $title, $path) { |
||
| 178 | /** |
||
| 179 | * Delete specified section |
||
| 180 | * |
||
| 181 | * @param int $id |
||
| 182 | * |
||
| 183 | * @return bool |
||
| 184 | */ |
||
| 185 | function del ($id) { |
||
| 216 | } |
||
| 217 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.