1 | <?php |
||
14 | abstract class Loader { |
||
15 | |||
16 | protected $dir_name = '', $items = []; |
||
17 | |||
18 | /** |
||
19 | * Load items |
||
20 | */ |
||
21 | |||
22 | protected function loadItems(array $pattern = []) : array { |
||
35 | |||
36 | /** |
||
37 | * Load an item data |
||
38 | * |
||
39 | * @return array|null : the data or null on failure |
||
40 | */ |
||
41 | |||
42 | protected function loadItem(string $name) { |
||
56 | |||
57 | /** |
||
58 | * Get the directory name |
||
59 | */ |
||
60 | |||
61 | public function getDirName() : string { |
||
65 | |||
66 | /** |
||
67 | * Get an item |
||
68 | * |
||
69 | * @return array|false : the item or false if the item does not exist |
||
70 | */ |
||
71 | |||
72 | public function getItem(string $name) { |
||
76 | |||
77 | /** |
||
78 | * Get the items list |
||
79 | * |
||
80 | * @param $plain : tells to return the array in simplified format ([$name => $title]) |
||
81 | */ |
||
82 | |||
83 | public function getItems(bool $plain = false) : array { |
||
87 | } |
||
88 | } |
||
89 |