Open WanWizard opened 11 years ago
There seems no sense in having empty classes at all.
Seeing how the Crud and ORM are two different approaches to working with the database, the Model class should have been the abstraction of common functionality. However, we don't really need the abstraction because the model classes would most likely have a different API, and then there's the lack of strong typing.
I agree, although having common Model functionality for the Crud part would be a plus in my bood. Maybe we could create an interface to which both models must comply. For things like ->set and validation functions?
The idea behind the empty classes has always been that you extend them by default. If, later, you decide to overload them in app, your controllers or models will automatically use your extended version, saving you from changing all your models or controllers...
@FrenkyNet I agree it would be beneficial if Model_Crud and Orm share a common API.
v1.x has two base models in the core: Model (which is an empty class), and Model_Crud.
Perhaps we should dump the empty class (what is the point of it being there?), and use Model_Crud as the base model provided by the framework.
The base model(s) must be part of the Foundation package.