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

ResultsetInterface::toArray's behavior is different to Model::toArray ?

if I override the Model::toArray for the Robots, when I use Robots::find()->toArray(), the returned value is not an array of Robots::toArray()'s result, is that a bug ? @phalcon



98.9k

Call Robots::find()->toArray() is in fact calling Phalcon\Mvc\Model\Query\Simple::toArray() https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_Model_Resultset_Simple.html#methods