1 | <?php |
||
16 | class Collection extends AbstractField implements \ArrayAccess, \Iterator |
||
17 | { |
||
18 | /** |
||
19 | * @var AbstractField[] List of children fields. |
||
20 | */ |
||
21 | protected $fields; |
||
22 | |||
23 | 8 | public function __construct($schema, $options = []) |
|
28 | |||
29 | /** |
||
30 | * Add a new child node to field list. |
||
31 | * |
||
32 | * @param string $name The field name. |
||
33 | * @param AbstractField $child Field instance. |
||
34 | */ |
||
35 | 5 | public function addField($name, AbstractField $child) |
|
39 | |||
40 | /** |
||
41 | * Recursively call parse method of all children and store values in associated DataSet. |
||
42 | * |
||
43 | * @api |
||
44 | * @param AbstractStream $stream Stream from which children read. |
||
45 | * @return array Array of parsed values. |
||
46 | */ |
||
47 | 6 | public function parse(AbstractStream $stream) |
|
76 | |||
77 | /** |
||
78 | * Recursively creates field instances form their declarations. |
||
79 | * |
||
80 | * @param array $fieldArray Array of declarations. |
||
81 | * @throws ConfigurationException If one of declarations are invalid. |
||
82 | */ |
||
83 | 7 | private function initFromArray(array $fieldArray = []) |
|
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | 1 | public function offsetExists($offset) |
|
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | 2 | public function offsetGet($offset) |
|
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | 1 | public function offsetSet($offset, $value) |
|
113 | |||
114 | /** |
||
115 | * @inheritdoc |
||
116 | */ |
||
117 | 1 | public function offsetUnset($offset) |
|
121 | |||
122 | /** |
||
123 | * @inheritdoc |
||
124 | * @return AbstractField |
||
125 | */ |
||
126 | 3 | public function current() |
|
130 | |||
131 | /** |
||
132 | * @inheritdoc |
||
133 | */ |
||
134 | 3 | public function next() |
|
138 | |||
139 | /** |
||
140 | * @inheritdoc |
||
141 | */ |
||
142 | 3 | public function key() |
|
146 | |||
147 | /** |
||
148 | * @inheritdoc |
||
149 | */ |
||
150 | 3 | public function valid() |
|
154 | |||
155 | /** |
||
156 | * @inheritdoc |
||
157 | */ |
||
158 | 3 | public function rewind() |
|
162 | } |