I have a form that is the bottleneck of my ajax-request.
$order = $this->getDoctrine()
->getRepository(\'AcmeMyBundle:Order\')
->fin
The described behavior looks as the work of the guesser. I have the feeling that there is need to show an some additional code (listeners, VariantType
, WebsiteType
, PartnerType
).
Let's assume a some class has association variant
to Variant
and FormType
for this class has code ->add('variant')
without explicit specifying type (as I see there is a lot of places where the type is not specified). Then DoctrineOrmTypeGuesser
comes in the game.
https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php#L46
This code assign the entity
type (!) to this child. The EntityRepository::findAll()
is called and all variants from DB are hydrated.
As for another form optimization ways: