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

Model instead of Row

Hello,

when you select something from database with predefined column set, you get Row instead of Model. Is there any simple way to convert Row to Model? Or maybe it's possible to force get Model instead of Row?



145.0k
Accepted
answer
edited Feb '20

No there is not. You will always have Row instance returned if you use columns. Phalcon doesn't provide partial models, you can only select full models because of how Active Record works.

Most likely in next Phalcon version when we will proide DataMapper there will be such option.