This topic contains 2 replies, has 2 voices, and was last updated by czaros45 6 years, 7 months ago.
- Topic
Hi everyone,
I need to make a datagrid with customers and their activities. I would like to see something like that:
Name of the customer:_________Number of activities:
CustomerA __________________________3
CustomerB __________________________5I found a table called: oro_rel_c3990ba6784fec5f23d770 and it solves my problem since it stores relation between customer_id and activity_id.
My approach would be like this:
1. Code a method which contains DQL query where I hardcode this name (it feels like it’s a not right way to do it)
2. According to this documentation I can make a class a service and use it in “query” field in datagrid: https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/datagrid.mdI’m forced to do it with a service because this:
1- { table: 'oro_rel_c3990ba6784fec5f23d770', alias: ca}calls that Class oro_rel_c3990ba6784fec5f23d770 does not exist.
My questions are:
– Is it simplier solution to this that I’m missing?
– How to get the name of the table in not hardcoded way? I found a Class ExtendDbIdentifierNameGenerator.php and a method generateManyToManyJoinTableName() which generates this name, although I cannot find a way to retrieve that name.Thanks in advance.
Cheers.
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.