| Justin Patrin 2006-08-28, 6:58 pm |
| On 8/28/06, Markus Fischer <markus@fischer.name> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Justin Patrin wrote:
>
> You mean, every time and at every place I factor a DataObject, I run
> something like
>
> $DO->getDatabaseConnection()->query("SET NAMES ...");
>
> ?
>
> But forgeting this at some point seems more error prone than having it
> part of DO ...
>
No, you only have to do this once for each database connection. I
would suggest doing it in the code that sets up the configuration for
your DOs. You *do* have that factored out, don't you?
It also makes sense to put this in the DO class, as you did, I was
just giving another possible solution which doesn't violate the
private method. Then again, I hack private stuff in my own code (and
even in a bit of PEAR code, but shhh, don't tell the QF devs).
--
Justin Patrin
|