Context is
----------

I have a Symfony2 form field of type `collection`, where the collection items are of the `entity` type. I use Symfony 2.7.

Problem is
----------

So far it works, but in this case, I have to apply a model data transformer to those collection items as described [in the Symfony Cookbook](http://symfony.com/doc/2.7/cookbook/form/data_transformers.html). I use this code snippet:

```
<?php
$builder
    ->add(
        $builder
            ->create('items', 'collection', array(
                'type' => 'entity',
                'options' => array(
                    'class' => 'AppBundle:Item',
                    'property' => 'name',
                    'label' => 'Item',
                ),
                'label' => 'Items',
                'allow_add' => true,
                'allow_delete' => true,
                'delete_empty' => true,
                'prototype' => true,
                'required' => false,
            ))
            // $options['em'] is the entity manager
            ->addModelTransformer(new ItemToNumberTransformer($options['em']))
    )
;

```

Unfortunately, this applies the model transformer to the whole collection and not one Item item of it. As a workaround, I modified the transformer to also work with arrays of items/ids instead of only a single item/id, but this kinda looks like the wrong place to handle this. Seems to me as if this is more of a syntactical problem.

Question is
-----------

Does anybody know how to apply model transformers to each item of a collection? Or ca anybody confirm this is simply not possible due to a limitaion in the Symfony framework?