tempest-framework icon indicating copy to clipboard operation
tempest-framework copied to clipboard

Model API

Open brendt opened this issue 1 year ago • 1 comments

Models themselves are simple data objects, but the IsModel trait and Model interface add a bunch of database-specific methods. We need to carefully think on this API before a 1.0 release. I'd rather drop it if we don't like it for 1.0, and only keep Query to Model mapping support. Up for debate.

brendt avatar Feb 24 '24 06:02 brendt

I think it would be an option to follow a bit what Symfony does and build on the mapper stuff by recommending using repositories, but in Tempest style. That would leave models to be mere PHP objects (unlike Doctrine and Laravel) and in the most basic implementation it can be just a call to map(new Query(...))

Jeroen-G avatar Oct 07 '24 17:10 Jeroen-G