I currently have the option in my application for a user to select favorite Items from a list. The form element is of type Entity and shows the list of objects. Users can select a number of them as their personal favorite.
However, although the list must show Items, what has to be stored is actually a FavoritedItem (which contains extra information about when/how the user favorited his Item).
I cannot figure out how to convert the entity types so that the user can pick from a list of Item entities but that the form stores FavoritedItems connected to the user.
I guess your entity has a relationship with FavoritedItem, when you are creating your form, don’t include that field, but a dummy field to contain the data the user selected:
Find this line:
and for each of your items, set the appropriate FavoritedItem on your entity. It would look something like: