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 fields

Hello,

When a Model is defined you can define the fields (properties) that exists in the database table, but what if in the model are defined just some of them, the findFirst method gets all table fields but I expected get only just the model defined fields, I think the query must be created applying a recursion on the model properties and get just that fields in the resultset, or there is any way to achive that.

Regards.

well you can create a new feature request on github it's a good idea

edited Oct '18

You can have additional fields in class without any problems. Not sure what problem you have. Model is ORM represtentation of your table, it must contain all columns defined in it, otherwise this is not ORM.