For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > February 2008 > SDG Datasource DB_Dataobject









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SDG Datasource DB_Dataobject
Mads Lie Jensen

2008-02-25, 4:25 am

Hi

I'm using Structures_Datagrid to display some data, using the
DB_DataObject-datasource.

However, there is one thing which puzzles me.
I have in my database some columns with underscores in their names:

dansk_navn, latinsk_navn

If I then have a getter in my DataObject called getDansk_navn(), it is
_not_ called by the datasource when getting data. But if I call it
getDanskNavn(), it gets called to fetch the data of dansk_navn.

Looking in the source of the DB_DataObject-datasource, it seems
intentional that it will strip of any _ when using getters. If no getter
is present, it will still get the correct data of the
dansk_navn-property.

Why is it like this? is it a bug?
--
Mads Lie Jensen - mads@gartneriet.dk - ICQ #25478403
Gartneriet - http://www.gartneriet.dk/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com