Re: Extending a class with a static constructur (like PEAR::DB)
| From: | Andreas Korthaus | Date: | Fri, 10 Mar 2006 09:56:25 +0000 |
| Subject: | Re: Extending a class with a static constructur (like PEAR::DB) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231753@lists.php.net to get a copy of this message | ||
Chris wrote:
You'll need to: $dbtoy = new DBToyExt(); $dbtoy->connect(....) $dbtoy->testext('testing');But you cannot do: $dbtoy = new DBToyExt(); $dbtoy->connect(....) $dbtoy->testext('testing'); $result = $dbtoy->query('SELECT...'); //[...] You have to do something like this: $dbtoy = new DBToyExt(); $db = $dbtoy->connect(....) $dbtoy->testext('testing'); $result = $db->query('SELECT...'); //[...] If you want to avoid that, you have to write a wrapper around DB. best regards Andreas