symfony2 - Sonata Admin & KNP Doctrine Behaoviour Traslations -
we have configured translations using doctrine behaviours. in sonata admin list view displayed translations of entity saved using doctrine behaviour. need show current locale translations. created function in entity , got translation transnationals table. , worked fine.
but became performance issue. on each record consults translations table , query executed there around 3000 rows displayed on view , collapsing system.
to implement in forms take translations input have configured a2lix translation form.
is there way display single translation using current locale in sonata admin?
you have place joins translations table cut down number of queries consult database each record. checking form current object.
like:
public function createquery($context = 'list') { $query = parent::createquery($context); $query->addselect('tl'); $query->innerjoin($query->getrootalias() . ".translations", "tl"); homecoming $query; }
it working in sonata admin. if want other sonata admin can set joins in repository.
symfony2 sonata-admin a2lix-translation
No comments:
Post a Comment