I'm trying to build my site around subclassing DataObject and using ModelAdmin for administrating in the CMS. I want to follow the practise of thick models and thin controllers, so essentially put all the data fetching in the models and then have thin controllers that just call model methods.
What I'm having trouble with is that when I extend DataModel like so: -
class Product extends DataModel {...}
I then still need to call DataModel::get(...) within in order to fetch data. What seems to be a normal OO approach would be to be able to make a call something like this: -
$this->get() or self::get()
In order to fetch all my products. It seems that I need to call DataModel::get('Product') even though I've subclassed DataModel. It may be that I've just missed something, but I can't grasp what the approach is supposed to be here. Subclassing DataModel and then still having to tell my data fetch calls which model to fetch from seems odd.