@@ -174,7 +174,7 @@ Or you may define a prototype for each node inside an array node::
174
174
$rootNode
175
175
->children()
176
176
->arrayNode('connections')
177
- ->prototype('array' )
177
+ ->arrayPrototype( )
178
178
->children()
179
179
->scalarNode('driver')->end()
180
180
->scalarNode('host')->end()
@@ -186,6 +186,12 @@ Or you may define a prototype for each node inside an array node::
186
186
->end()
187
187
;
188
188
189
+ .. versionadded :: 3.3
190
+ The ``arrayPrototype() `` method (and the related ``booleanPrototype() ``
191
+ ``integerPrototype() ``, ``floatPrototype() ``, ``scalarPrototype() `` and
192
+ ``enumPrototype() ``) was introduced in Symfony 3.3. In previous versions,
193
+ you needed to use ``prototype('array') ``, ``prototype('boolean') ``, etc.
194
+
189
195
A prototype can be used to add a definition which may be repeated many times
190
196
inside the current node. According to the prototype definition in the example
191
197
above, it is possible to have multiple connection arrays (containing a ``driver ``,
@@ -229,7 +235,7 @@ A basic prototyped array configuration can be defined as follows::
229
235
->fixXmlConfig('driver')
230
236
->children()
231
237
->arrayNode('drivers')
232
- ->prototype('scalar' )->end()
238
+ ->scalarPrototype( )->end()
233
239
->end()
234
240
->end()
235
241
;
@@ -260,7 +266,7 @@ A more complex example would be to define a prototyped array with children::
260
266
->fixXmlConfig('connection')
261
267
->children()
262
268
->arrayNode('connections')
263
- ->prototype('array' )
269
+ ->arrayPrototype( )
264
270
->children()
265
271
->scalarNode('table')->end()
266
272
->scalarNode('user')->end()
@@ -334,7 +340,7 @@ In order to maintain the array keys use the ``useAttributeAsKey()`` method::
334
340
->children()
335
341
->arrayNode('connections')
336
342
->useAttributeAsKey('name')
337
- ->prototype('array' )
343
+ ->arrayPrototype( )
338
344
->children()
339
345
->scalarNode('table')->end()
340
346
->scalarNode('user')->end()
@@ -549,7 +555,7 @@ tree with ``append()``::
549
555
->isRequired()
550
556
->requiresAtLeastOneElement()
551
557
->useAttributeAsKey('name')
552
- ->prototype('array')
558
+ ->arrayPrototype
553
559
->children()
554
560
->scalarNode('value')->isRequired()->end()
555
561
->end()
@@ -647,7 +653,7 @@ with ``fixXmlConfig()``::
647
653
->fixXmlConfig('extension')
648
654
->children()
649
655
->arrayNode('extensions')
650
- ->prototype('scalar' )->end()
656
+ ->scalarPrototype( )->end()
651
657
->end()
652
658
->end()
653
659
;
0 commit comments