I'm trying to extend my ActiveRecord class with some dynamic methods. I would like to be able to run this from my controller
$user = User::find_by_username(param);
$user = User::find_by_email(param);
I've read a little about overloading and think that's the key. I'v got a static $_attributes
in my AR class and I get the table name by pluralizing my model (User = users) in this case.
How do I do this? All models extends the ActiveRecord class.