Forums

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

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 1 year, 6 months ago.

  • Creator
    Topic
  • #24634
    Su
    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
    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)

You must be logged in to reply to this topic.

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

Yes No