CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
calling class methods, determined at runtime (ORLite)


New User

Oct 14, 2012, 5:16 AM

Post #1 of 1 (2215 views)
calling class methods, determined at runtime (ORLite) Can't Post


I am trying to make a crm application with a lot of crud actions. So I have controller classes like

No I use ORLite as a lite weight ORM. It creates -on the fly- classes like so

Now say I want to load a city. In the CRM::Cities class I do something like
$obj1 = Model::Cities->load($id);
To load the current country in CRM::Countries:
$obj1 = Model::Countries->load($id);
So I end up in each crm-controller class to enclose similar lines.

What I would want to be able todo is to do something generic like this in the CRM package (the superclass):

$obj1 = Model::$package->load($id);
#where $package is Cities or Countries ...

I tried with various variations , with eval and so on but this is higher order perl. I think b/c the ORLite methods are class methods, inheritance is less obvious. Can someone give advice? tia !



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives