Classes | |
| class | Db |
| class | DbObject |
The most important one is the Db object, which provides one centralized way to get access to the current database connection. In fact, there is no reason for classes that require database access to use the PDb framework directly, as the Db.getDb() singleton method will transparently load the database information from the configuration file, connect to it and return a working connection.
In order to get a working database connection, this is all you need to do:
$db =& Db.getDb();
For those classes that extend the Model base class, the private attribute Model._db is a database connection so there is no need to initialize a new one.