Open leth opened 13 years ago
Cool :)
I've published my branch. I've only gone far enough to support loading models directly, nothing complex yet.
It's a long way off being finished though, and I have the suspicion that there remain better ways of doing things.
There are 3 unit tests on polymorphic modes, currently, the third tests for behaviour I've not implemented yet so only passes for the simplest dataset item.
I've made some design decisions which feel kind of major, I'd appreciate some comments on my ideas:
parent::initialize($meta)
is optional.In order for a single db query to return instances of a class and its subclasses we'll need to explicitly join their tables. Therefore we need to know in advance which tables to join.
Since we can't find a list of all subclasses (because they may have not yet been autoloaded) I've decided that subclasses must be explicitly registered in the initialize(...)
method.
I've pushed subclass detection in query results. It's a bit hacky, but the tests pass now :)
As always, comments welcome!
Nice work, keep going. I'll go through it when we're ready with the 3.2 branch,
I am working on it!
I've got rudimentary field inheritance working, but I haven't attempted anything which touches the database yet :P I'll post a link to the branch once I've got something worth sharing.
As always, comments suggestions and feature requests are welcome :)