1 | <?php |
||
11 | class Repository { |
||
12 | /** |
||
13 | * List of registered unique panel identificator ids |
||
14 | * |
||
15 | * @see get_unique_panel_id() |
||
16 | * @see register_unique_panel_id() |
||
17 | * @see unregister_unique_panel_id() |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $registered_panel_ids = array(); |
||
21 | |||
22 | /** |
||
23 | * List of registered containers that should be initialized |
||
24 | * |
||
25 | * @see initialize_containers() |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $pending_containers = array(); |
||
29 | |||
30 | /** |
||
31 | * List of all containers |
||
32 | * |
||
33 | * @see _attach() |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $containers = array(); |
||
37 | |||
38 | /** |
||
39 | * Register a container with the repository |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | 5 | public function register_container( Container $container ) { |
|
48 | |||
49 | /** |
||
50 | * Initialize registered containers |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | 3 | public function initialize_containers() { |
|
63 | |||
64 | /** |
||
65 | * Return all containers |
||
66 | * |
||
67 | * @param string $type Container type to filter for |
||
68 | * @return array |
||
69 | */ |
||
70 | public function get_containers( $type = null ) { |
||
87 | |||
88 | /** |
||
89 | * Return field in containers |
||
90 | * |
||
91 | * @param string $field_name |
||
92 | * @param string $container_type Container type to filter for |
||
93 | * @param bool $include_nested_fields Search in nested fields as well |
||
94 | * @return Carbon_Fields\Field\Field |
||
95 | */ |
||
96 | public function get_field_in_containers( $field_name, $container_type = null, $include_nested_fields = true ) { |
||
113 | |||
114 | /** |
||
115 | * Return all currently active containers |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | public function get_active_containers() { |
||
124 | |||
125 | /** |
||
126 | * Generate a unique container identificator id based on container title |
||
127 | * |
||
128 | * @param string $title |
||
129 | */ |
||
130 | 3 | public function get_unique_panel_id( $title ) { |
|
142 | |||
143 | /** |
||
144 | * Check if container identificator id is unique |
||
145 | * |
||
146 | * @param string $id |
||
147 | */ |
||
148 | protected function is_unique_panel_id( $id ) { |
||
151 | |||
152 | /** |
||
153 | * Add container identificator id to the list of unique container ids |
||
154 | * |
||
155 | * @param string $id |
||
156 | */ |
||
157 | protected function register_unique_panel_id( $id ) { |
||
162 | |||
163 | /** |
||
164 | * Remove container identificator id from the list of unique container ids |
||
165 | * |
||
166 | * @param string $id |
||
167 | */ |
||
168 | protected function unregister_unique_panel_id( $id ) { |
||
173 | } |
||
174 |