<p dir="auto">Currently, the form component add some strong requirements on the way to access field values. It would be a good idea to allow to specify a different getter or setter (defaulting to the current behavior) to give more flexibility.</p>
<p dir="auto">And for collections, it would be a good idea to be able to use <code class="notranslate">addXXX</code> and <code class="notranslate">removeXXX</code> instead of recreating the collection entirely using a <code class="notranslate">setXXXs</code> setter, which has really bad performances for Doctrine toMany relations as it removes all relations and add new ones.</p>
<p dir="auto">The collection type is broken when using it for the inversed side of a Doctrine relation as it modifies the collection instead of calling some setter in the class. As Doctrine does not track changes in the inversed side, the changes are not persisted.</p>
<p dir="auto">The best practice for Doctrine is to call the setter of the owning side in the setter of the inversed side. But as the setter is not called, this has no effect for the forms. And there is currently no way to change this behavior in user-land forms.</p>
<p dir="auto">I suggested in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="970309" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/1141" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/1141/hovercard" href="https://github.com/symfony/symfony/issues/1141">#1141</a> to allow defining the setter used. A collection type should then call <code class="notranslate">addXXX</code> and <code class="notranslate">removeXXX</code> on the object instead of modifying the collection to allow having additionnal logic when adding and removing elements.</p>