Issues

ZF-301: Remove requirement for camelcaps transforms for Db fields

Issue Type: New Feature Created: 2006-08-02T22:24:44.000+0000 Last Updated: 2008-12-19T13:36:40.000+0000 Status: Closed Fix version(s): Reporter: Simon Mundy (peptolab) Assignee: Bill Karwin (bkarwin) Tags: - Zend_Db

Related issues: - ZF-50

Attachments:

Description

Apart from providing a more code-friendly appearance, I feel that the camelcaps transform on field names creates another unnecessary layer of abstraction. If my database has user_list_id and member_status, it is far more readable and understandable for those looking through the code to refer to the field names as-is. Especially as the insert/update and where criteria code still relies on the 'uncamelised' id, this treatment seems a bit inconsistent and redundant, considering the inflector that is needed to re-transform them back to the original field name.

I'm not saying to ditch this feature (as I'm sure some people do quite like this), however wish it to be a configurable option. Ideally you would enable/disable when you instantiate the Db object.

<pre class="highlight">
$params = array ('host'     => '127.0.0.1',
                 'username' => 'malory',
                 'password' => '******',
                 'dbname'   => 'camelot',
                 'transform' => Zend_Db::CASE_DEFAULT);

$db = Zend_Db::factory('PDO_MYSQL', $params);

CASE_DEFAULT = Unchanged CASE_MIXED = Uppercase words (Camel style - strip underscores) CASE_LOWER = Lowercase (retain underscores) CASE_UPPER = Uppercase (retain underscores)

Comments

Posted by Gavin (gavin) on 2006-08-08T21:56:15.000+0000

Almost the same as ZF-50, so let us all put our comments on these topics in ZF-50.

Posted by Wil Sinclair (wil) on 2008-12-19T13:36:39.000+0000

Bookkeeping. Closing old issues and assigning them to the person who ultimately resolved the issue.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts