|
|||
|
I'm working on a project where the column names are in uppercase, with words separated by underscores.
Is there any built in option in Zend_Db to automagically have these column names transformed into camelCase when you fetch stuff? For instance, if I'm fetching an object it would be nice to have $obj->userId instead of $obj->USER_ID. Edit: And by the way, I'm using the Pdo_Mssql driver. Best Regards, Troxy Last edited by troxy : 10-15-2007 at 12:59 AM. |
|
|||
|
Okay, so you have to extend the Zend_Db_Table and Zend_Db_Table_Row.
The extended table class might look like this: PHP Code:
PHP Code:
PHP Code:
|
|
|||
|
Quote:
The schema is defined using lower_case_underscore format, and the ZF standard is to use lowerCamelCase. Do we really have to resort to a hack like this? It's a nice hack, and I think we'll probably use it for my project, but I'm wondering if there's anything else out there. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|