Skip to content

Instantly share code, notes, and snippets.

@heathdutton
Created February 12, 2018 19:59
Show Gist options
  • Save heathdutton/3b405929b8f7bec0cee464a329284b9a to your computer and use it in GitHub Desktop.
Save heathdutton/3b405929b8f7bec0cee464a329284b9a to your computer and use it in GitHub Desktop.
Get a raw query equivalent w/ doctrine (hacky, only for debugging)
$sql = $query->getSQL();
foreach($query->getParameters() as $key => $val) {
if (is_numeric($val)) {
$sql = str_replace(':' . $key, $val, $sql);
} else {
$sql = str_replace(':' . $key, '"'.$val.'"', $sql);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment