Re: New PDO-based DBAL/ORM for PEAR2

From: Date: Wed, 21 Nov 2007 01:53:54 +0000
Subject: Re: New PDO-based DBAL/ORM for PEAR2
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-48532@lists.php.net to get a copy of this message
On Nov 20, 2007, at 1:29 PM, Bertrand Mansion wrote:
Le 20 nov. 07 à 18:51, Michael J. I. Jackson a écrit :
On Nov 20, 2007, at 6:36 AM, Bertrand Mansion wrote:
and remove the singleton method.
Why?
Singleton what ? Doesn't mean anything for me.
Singleton doesn't create a new database instance. Instead, if you are connecting with the same DSN, username, and password, it will return the same database connection that has already been established with that combination. It's nice so that you don't create multiple database connections with the exact same connection parameters.
$person->books is the same as $person->getBooks() except that the first one won't refetch from database if books are already loaded. Fields are accessed with ArrayAccess: $author['first_name']. This is more logical and PHP-like IMO. I strongly advise you to think about it :)
Array accessors are a good idea. It will be easy to do. Thanks, Michael

« previous php.pear.dev (#48532) next »