Q:

How to make Symfony Form to use addSomething() / removeSomething() methods of the underlying object?

Suppose I have User object, which has $emails field. User object also has addEmail() and removeEmail() methods. 
In my form type (UserType) I use CollectionType for $emails field.
After submitting a form, I want methods User::addEmail() and User::removeEmail() to be called instead of User::setEmails(). 
Is it possible?

A:

Yes it is possible, you just have to add the option 'by_reference' => false when building the form field.

