Skip to content

Add note about special handling of 'name' argument #13423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ In order to maintain the array keys use the ``useAttributeAsKey()`` method::
->end()
;

.. note::

If using YAML, then the ``'name'`` argument of ``useAttributeAsKey`` has a special meaning and refers to the key of the map (``sf_connection`` and ``default`` in this example). If a child node was defined for the ``connections`` node with the name ``name``, then the key of the map would be lost.

The argument of this method (``name`` in the example above) defines the name of
the attribute added to each XML node to differentiate them. Now you can use the
same YAML configuration shown before or the following XML configuration:
Expand Down