DB_DataObject
| From: | Craig Ambrose | Date: | Sat, 02 Oct 2004 08:52:55 +0000 |
| Subject: | DB_DataObject | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14729@lists.php.net to get a copy of this message | ||
Hi, I'm trying to get my head around DB_DataObject. I've implemented the
sample code in the documentation, and it works very nicelly indeed. What I'm
curious about is, when exactly does the database connection happen?
Does it open a new connection each time an sql statement is required (such as
when call $person->get()). If so, how is this for efficiency? Previously my
app was opening a single connection for all the queries required for that php
process.
Secondly, is there any way to make it use a specific pear DB object? I'd like
to be able to use these DB_DataObject(s) in conjuction with unit tests, and
it might be nice to be able to pass in a 'mock' database object.
regards,
Craig
--
Craig Ambrose
Freelance Web Developer
http://www.portallus.com/people/craigambrose/