both methods are used to do the same thing
It is true, but only when your definition of model is equal to the definition of entity. The problem is that they are not the same.
You may create a class, let's call it AwesomeMovieDomain
and this class will not be a model. You will use it as an entity. You can bind an entity of AwesomeMovieDomain
class to the form. AwesomeMovieDomain
can have protected property $_starring
and it will be an array where each element will be an entity of a model Actor
.
This is a problem that I am now struggling on too. Some keywords that are connected to this topic and that I am trying to get familiar with are: DDD - domain driven development, entities, models, domains, services, application architecture, design patterns etc. AFAIK models in Phalcon are following a design pattern called "Active Record".