1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::ColumnCase;
7 use base qw/DBIx::Class/;
9 sub _register_column_group {
10 my ($class, $group, @cols) = @_;
11 return $class->next::method($group => map lc, @cols);
15 my ($class, @cols) = @_;
16 $class->mk_group_accessors(column => @cols);
17 $class->result_source_instance->add_columns(map lc, @cols);
21 my ($class, $col, @rest) = @_;
22 $class->next::method(lc($col), @rest);
23 $class->mk_group_accessors('inflated_column' => $col);
28 my ($class, $rel, $f_class, $f_key, @rest) = @_;
29 return $class->next::method($rel, $f_class, ( ref($f_key) ?
34 sub get_inflated_column {
35 my ($class, $get, @rest) = @_;
36 return $class->next::method(lc($get), @rest);
39 sub store_inflated_column {
40 my ($class, $set, @rest) = @_;
41 return $class->next::method(lc($set), @rest);
44 sub set_inflated_column {
45 my ($class, $set, @rest) = @_;
46 return $class->next::method(lc($set), @rest);
50 my ($class, $get, @rest) = @_;
51 return $class->next::method(lc($get), @rest);
55 my ($class, $set, @rest) = @_;
56 return $class->next::method(lc($set), @rest);
60 my ($class, $set, @rest) = @_;
61 return $class->next::method(lc($set), @rest);
65 my ($class, $col) = @_;
66 return $class->next::method(lc($col));
71 # Build a query hash for find, et al. Overrides Retrieve::_build_query.
74 my ($self, $query) = @_;
77 $new_query{lc $_} = $query->{$_} for keys %$query;
82 sub _mk_group_accessors {
83 my ($class, $type, $group, @fields) = @_;
84 #warn join(', ', map { ref $_ ? (@$_) : ($_) } @fields);
87 my ($acc, $field) = ref $_ ? @$_ : ($_, $_);
88 #warn "$acc ".lc($acc)." $field";
89 next if defined &{"${class}::${acc}"};
90 push(@extra, [ lc $acc => $field ]);
92 return $class->next::method($type, $group,
97 my ($class, $attrs, @rest) = @_;
99 $att{lc $_} = $attrs->{$_} for keys %$attrs;
100 return $class->next::method(\%att, @rest);