Forums

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 5 years, 11 months ago.

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

  • Creator
    Topic
  • #24634

    Su
    Participant

    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
    Replies
  • #24636

    ibratsilo
    Moderator

    Hi,

    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.

Back to top