1 | <?php |
||
8 | class Component_composite |
||
9 | extends AbstractComponent |
||
|
|||
10 | implements ValueComponentInterface, |
||
11 | DisableableComponentInterface, |
||
12 | FilterableComponentInterface, |
||
13 | ValidatableComponentInterface |
||
14 | { |
||
15 | /** |
||
16 | * The list of child components. |
||
17 | * |
||
18 | * @var UI\AbstractComponent[] |
||
19 | */ |
||
20 | private $components; |
||
21 | |||
22 | /** |
||
23 | * The __set magic method is overridden here to apply value changes to |
||
24 | * child components. |
||
25 | */ |
||
26 | public function __set( $name, $value ) |
||
35 | |||
36 | /** |
||
37 | * Apply the value to each of the child components. |
||
38 | * |
||
39 | * @param array $value |
||
40 | */ |
||
41 | public function set_value( array $value ) |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function default_model() |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function required_arguments() |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function get_template_path() |
||
82 | |||
83 | /** |
||
84 | * Parse the template by converting the name tokens into UI components. |
||
85 | * |
||
86 | * @return string The parsed template |
||
87 | */ |
||
88 | public function parse_template() |
||
95 | |||
96 | /** |
||
97 | * If this is the root composite component, this will return the component's |
||
98 | * name. If this is a child composite component, this will return the |
||
99 | * component's name as a key in the parent's array, i.e 'parent_name[child_name]' |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function get_name() |
||
111 | |||
112 | /** |
||
113 | * Instantiate child UI components when created. |
||
114 | */ |
||
115 | protected function on_created() |
||
122 | |||
123 | /** |
||
124 | * |
||
125 | * @param type $args |
||
126 | * @return type |
||
127 | */ |
||
128 | private function create_component( $args ) |
||
144 | |||
145 | /** |
||
146 | * Get a child component by name. |
||
147 | * |
||
148 | * @param string $name |
||
149 | * @return UI\AbstractComponent |
||
150 | * @throws \RuntimeException If there's no child component corresponding to the given name |
||
151 | */ |
||
152 | private function get_component( $name ) |
||
160 | } |