We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

About the results

ex: $phql = "SELECT c.* FROM Cars AS c ORDER BY c.name"; $cars = $manager->executeQuery($phql);

if i want a value, i have to write
"foreach ($cars as $car) { echo "Name: ", $car->name, "\n"; };" so i want to get a array? i just write "var_dump($cars);"

how to do it?

edited Oct '15

i am not 100% sure, but I think it returns a model instance.

can you try


Sorry if i am wrong, i dont use the model manager to create custom queries


原生phql 查询返回的是对象形式,我想直接取得的结果是数组形式,该怎么写?

edited Oct '15

You can use ->toArray() on both the QueryInterface returned by executeQuery and the iterated row ModelInterfaces.

foreach($cars as $car) {