Re: [ANNOUNCEMENT] DB_DataObject-0.19 (stable) Released.

From: Date: Fri, 23 May 2003 15:24:00 +0000
Subject: Re: [ANNOUNCEMENT] DB_DataObject-0.19 (stable) Released.
References: 1 2  Groups: php.pear.general php.pear.general 
Request: Send a blank email to pear-general+get-5577@lists.php.net to get a copy of this message
http://devel.akbkhome.com/peardoc2/package.database.db-dataobject.db-dataobject.settersgetters.html basically overload with __call(), means that if you have your standard person object with name and birth_day .. and with just the standard autogenerated file. Then do echo $person->getName(); echo $person->getBirth_Day(); it is equivilant to doing echo $person->name; echo $person->birth_day; and it will work, even though there is no method getName defined anywhere.. now if a bit later on you decide you dont like the iso format for birth day - you can really define a method getBirth_Day(), to return a formated version. In which case the default __call method is not used.. be a little carefull that setters and gettes accept each others input and output, as setFrom relays into setters, and toArray relays into getters.. Regards Alan The Php_kid wrote:
Hi, what is this ? -> -> - overload extension enabled to relay setFrom and toArray calls -> to get*, set* -> methods, which are predefined as -> getXXX = returns $object->XXX -> setXXX($V) = returns true (or an error string if you create your own) -> (only affects php-4.3.2RC2 or later..) -> Thanks ! Regards mac -- ...ThE PhP_KiD.


« previous php.pear.general (#5577) next »