Covering OroCommerce, OroCRM, OroPlatform topics, including community updates and company announcements.

Forums Forums Oro Community How to print/var_dump the sql qiery in datagrids.yml ?

This topic contains 1 reply, has 2 voices, and was last updated by ibratsilo ibratsilo 2 years, 1 month ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #24634

    I want to print or var_dump the SQL query generated in datagrids.yml file in the bundle. How can I achieve this?

    Any suggestions would be appreciated.

Viewing 1 replies (of 1 total)
  • Author
  • #24636


    It depends on your needs. The easiest way to see whole query is open Database queries tab in symfony developer toolbar (it is available in dev mode). There you will see a list of all executed queries for current request as well as datagrid query.

    If you want to see it in code you may look at Oro\Bundle\DataGridBundle\Twig\DataGridExtension::getGridData(). Object DatagridInterface $grid has datasource property and it in its turn gives access to Query Builder. Which actually stores all parts of query, and can be converted to dql, sql, etc.

    But of course for such debugging purposes Xdebug will suit much more than printing variables content.

Viewing 1 replies (of 1 total)

The forum ‘Oro Community’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No