NYCPHP Meetup

NYPHP.org

[nycphp-talk] How to dynamically generate class methods based on db field values

soazine at pop.erols.com soazine at pop.erols.com
Tue Oct 14 17:32:58 EDT 2003


I am having to be tasked with a rather painful task of updating an existing
class by adding a dynamic amount of database field values; for each
database field value there has to be a generated array inside the class
plus a function "get method" to return it. 

I do not want to have to constantly type out:

function getStuff() {
  return $this->stuff;
}

for every occurrence of stuff I find that is generated by the database
SELECT call on the fields of as many as 20 different tables!! This is
enormous and I would love a more dynamic, functional method to generate..
methods.

Can someone give me an idea of how this can be done?

Thanx
Phil

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .





More information about the talk mailing list