DataObject optimization
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Mon, 21 Feb 2005 08:58:42 +0000 |
| Subject: | DataObject optimization | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17589@lists.php.net to get a copy of this message | ||
Hi,
Is it useful to delete dataobject (if we want more performance) with $do =
null or unset($do) ?
Is it depending on the instanciate method : factory or new ? What's the
best way ? Does it cost a lot ?
Another thing, here is a code example :
$do = new DataObject_foo;
while ($do->fetch()) {
$do2 = new DataObject_foo2;
$do2->find();
while ($do2->fetch()) {
//...
}
}
the code above works differently :
$do = new DataObject_foo;
//i instanciate before loops
$do2 = new DataObject_foo2;
while ($do->fetch()) {
$do2->find();
while ($do2->fetch()) {
//...
}
}
any method with the $do2 object works only on the first cycle of the first
loop but i don't understand why ?
Thx !
JP Dumont