Re: Extending a class with a static constructur (like PEAR::DB)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux