Skip to content

Instantly share code, notes, and snippets.

@desyncr
Created October 27, 2018 09:44
Show Gist options
  • Save desyncr/b342fa24e66d061b8be44d3c81d4a4a1 to your computer and use it in GitHub Desktop.
Save desyncr/b342fa24e66d061b8be44d3c81d4a4a1 to your computer and use it in GitHub Desktop.
doctrine print query
// execute & set object
$vals = $t->getFlattenedParams();
foreach(explode('?', $t->getSqlQuery()) as $i => $part) {
$sql = (isset($sql) ? $sql : null) . $part;
if (isset($vals[$i])) $sql .= $vals[$i];
}
echo $sql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment