1 | <?php |
||
12 | class Stencil_Installables { |
||
13 | |||
14 | /** |
||
15 | * List of registered installables. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | private $installables = array(); |
||
20 | |||
21 | /** |
||
22 | * Register all installable items. |
||
23 | */ |
||
24 | public function __construct() { |
||
37 | |||
38 | /** |
||
39 | * Add an installable to the list. |
||
40 | * |
||
41 | * @param Stencil_Installable_Interface $installable Installable to add. |
||
42 | */ |
||
43 | public function add_installable( Stencil_Installable_Interface $installable ) { |
||
46 | |||
47 | /** |
||
48 | * Get Installable by slug. |
||
49 | * |
||
50 | * @param string $slug Slug to find. |
||
51 | * |
||
52 | * @return mixed|null |
||
53 | */ |
||
54 | public function get_by_slug( $slug ) { |
||
63 | |||
64 | /** |
||
65 | * Retrieve all plugins |
||
66 | * |
||
67 | * @return Iterator list of Plugins. |
||
68 | */ |
||
69 | public function get_plugins() { |
||
72 | |||
73 | /** |
||
74 | * Get all registered themes. |
||
75 | * |
||
76 | * @return Iterator list of Themes. |
||
77 | */ |
||
78 | public function get_themes() { |
||
81 | |||
82 | /** |
||
83 | * Get upgradable installables |
||
84 | * |
||
85 | * @return array of upgradable installables. |
||
86 | */ |
||
87 | public function get_upgradable() { |
||
98 | |||
99 | /** |
||
100 | * Get specific installables. |
||
101 | * |
||
102 | * @param string $class Class to get objects of. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | private function get_installable_filtered( $class ) { |
||
117 | } |
||
118 |