How can I access a field outside the entity from a twig file that is the template of another attribute in Sonata Admin

45 views Asked by At

In my createQuery I am adding an addSelect with a count of a relation and I want to access that count from a twig file that is the template of another attribute.

The object "object" in the twig is the representation of the entity, but it does not include the virtual field that I created using the addSelect of the query.

I tried everything, in fact accessing the datagrid but with that he would be duplicating the queries.

0

There are 0 answers