Created
May 2, 2013 11:55
-
-
Save opi/5501735 to your computer and use it in GitHub Desktop.
Debug Drupal EntityFieldQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_query_alter(). | |
* | |
* Adds a tag management named "query_debug" that permits to retrieve | |
* the concerned request implementing this tag. | |
* Only for development use. Custom requests SHOULDN'T implement this tag in a | |
* production website. | |
*/ | |
function mymodule_query_alter($query) { | |
if ($query->hasTag('query_debug') && module_exists('devel')) { | |
dpm(strtr((string) $query, $query->getArguments())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have something similar, but prevents duplication and uses the
dpq()
function from devel. https://gist.github.com/KeyboardCowboy/78a0c6def01f666c5f55d33712171e20