Skip to content

Instantly share code, notes, and snippets.

@jmauerhan
Created August 4, 2015 21:34
Show Gist options
  • Save jmauerhan/7df914d3c6f3e4734bc0 to your computer and use it in GitHub Desktop.
Save jmauerhan/7df914d3c6f3e4734bc0 to your computer and use it in GitHub Desktop.
$dql = "SELECT orderStatus.id
FROM \models\OrderStatus orderStatus
WHERE orderStatus.isCompleted = true";
var_dump($this->getEntityManager()->createQuery($dql)->getScalarResult());
getScalarResult Output:
array (size=1)
0 =>
array (size=1)
'id' => string '5' (length=1)
getResult Output:
array (size=1)
0 =>
array (size=1)
'id' => int 5
getArrayResult Output:
array (size=1)
0 =>
array (size=1)
'id' => int 5
Desired Output:
array (size=1)
0 => int 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment