Re: DB_DataObject: what am I missing?
| From: | Torsten Roehr | Date: | Sun, 23 Jan 2005 20:27:12 +0000 |
| Subject: | Re: DB_DataObject: what am I missing? | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17113@lists.php.net to get a copy of this message | ||
"Larry Garfield" <larry@garfieldtech.com> wrote in message
news:41F403F9.7080406@garfieldtech.com...
> Justin Patrin wrote:
>
> > The fix for this is:
> > define('DB_DATAOBJECT_NO_OVERLOAD', 1);
> > Set this before you include any DO files in any script. This may also
> > fix your other problem. IMHO this should be disabled by default
> > because overloading breaks pass-by-ref.
>
> The current bug aside, why are people so against overloading? Without
> the accessor/modifier methods, you have to access the data directly,
> which breaks encapsulation. (Yes, I happen to like OO concepts. <g>)
> You could just write them yourself (as you would have to in Java or many
> other languages), but then you're losing half of the point of using DBDO
> in the first place.
Hi Larry,
my patch that adds automatic generation of getters and setters to the
DB_DataObject class generator has been added to CVS two days ago. So you
don't have to "write them yourself" anymore ;)
Using overload for accessors may be decent but setters should be customized
to include proper input validation.
Best regards,
Torsten