I want to get an array of values from the id column of the Auction table.
If this was a raw SQL I would write:
SELECT id FROM auction
But when I do this in Doctrine and execute:
$em->createQuery("SELECT a.id FROM Auction a")->getScalarResult();
I get an array like this:
array(
array('id' => 1),
array('id' => 2),
)
Instead, i'd like to get an array like this:
array(
1,
2
)
How can I do that using Doctrine?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…