Use new factory syntax

| Q   | A
| --- | ---
| Doc fix? | no
| New docs? | yes (https://github.com/symfony/symfony/pull/12008)
| Applies to | 2.6+
| Fixed tickets | #4291
You could add an API link for the `setFactory()` method. Otherwise, there were no link to it in the document.