George Whewell
unread,May 23, 2012, 9:13:42 AM5/23/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redbeanphp
Hello, wondering what the standard practice is for implementing
inheritance with models in redbean is.
For example I have an abstract model 'account' where most of the
shared code resides, extended to several different types of account
abstract class Model_Account extends RedBean_SimpleModel {
/* Shared methods */
function hello(){ return 'hello!'; }
}
class Model_SiteA_Account extends Model_Account {
function about_me(){ return 'site A account'; }
}
class Model_SiteB_Account extends Model_Account {
function about_me(){ return 'site B account'; }
}
Using R::find('sitea_account') returns the correct model, implementing
the methods from the parent class, but I can't seem to find a way to
return a mixed set of all accounts. R::find('account') obviously
doesn't find anything, and I can't seem to find a way to query
multiple tables at once.
Does anyone have any suggestions?
Thanks