On 14 Oct 2003 14:29:49 -0700,
soazine@erols.com (Phil Powell) wrote:
[color=blue]
>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?[/color]
Not that it helps now, but PHP5 has improvments to the object features to
allow autoloaded methods, similar to 'sub AUTOLOAD' in Perl classes.
http://www.php.net/zend-engine-2.php
(scroll to the bottom).
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (
http://www.andyh.co.uk)
Space: disk usage analysis tool (
http://www.andyhsoftware.co.uk/space)