Re: DB_DataObject

From: Date: Wed, 28 Sep 2005 20:46:21 +0000
Subject: Re: DB_DataObject
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21137@lists.php.net to get a copy of this message
steven scott wrote: > Hello, > > I have a couple of questions about DB_DataObject. I am a developer > putting together a rather large website and we need some serious data > abstraction to clean things up. > > We have master and slave databases and we do all the writing to the > master and reads all come from the slaves. (usually) Is there a way > to set up two database objects one to read from and one to write from > automatically within the DB_DataObject class. > > Also if we already have a pear::DB object instantiated is is possible > to just use that object instead of creating another connection to the > db. We try to keep one connection open across the application. To > limit the connection times. > > > Thanks for any help. > -Steven > Where I work, we have LDAP being the user database, MySQL table holding comments about users, and a MySQL table that controls the updating of the data. So, I made a separate DB_DO class that overrides the find, get and such to talk with LDAP and the comments table. Then, the update, delete, create functions are overrode to interact with the other MySQL table. It wasn't all that easy to get it working (especially since LDAP isn't really supported at all), but it eases coding. In our cade, all we care about is one DB_DO class and the rest is taking care of behind the scenes. If there is another way, I would also love to hear it. I don't know the answer to your other question. Trevan -- Trevan Richins Computer Science Dep. System Admin

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.general (#21137) next »