johnnywang has asked for the wisdom of the Perl Monks concerning the following question:
Basically there seems to be some inconsistency as to the cases of method names, and columns are lower cased internally. Any comments as to the reason?package Foo use base 'Class::DBI'; # declare columns to be capital letters to # coincide with database column names. Foo->columns(All=>qw/ID STATUS/); # In the place where Foo is used my $foo = Foo->retrieve(100); # getters $foo->STATUS(); # ok $foo->get('STATUS'); # ok $foo->Status(); # ok $foo->get('Status'); # ok # setters $foo->STATUS(3); # ok $foo->Status(3); # not ok: can't locate object method Status $foo->set('STATUS',3); # ok $foo->set('Status',3); # ok # elements in @columns are all lower cased my @columns = $foo->columns;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: lower case column names for Class::DBI
by perrin (Chancellor) on Nov 11, 2004 at 16:40 UTC |