Closed
Description
Right now, CollectionType is designed to work only with numerically and incrementally indexed collections. An interesting extension (see #7807) is to allow customly indexed collections as well by using the value of one of the fields in a row as key for the respective entry. The feature could be activated by setting an option such as index_by
that configures the property path to the key in the data of the row.
Example:
$builder->add('employees', 'collection', array(
'type' => 'employee',
'index_by' => 'sin',
));