| 1 | package # hide from PAUSE | ||||||||||||||||||||
| 2 | DBIx::Class::CDBICompat::ColumnCase; | ||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 0 | ▶ | sub _register_column_group { | ||||||||||||||||||
|
Subroutine
_register_column_group: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 8 | 0 | my ($class, $group, @cols) = @_; | |||||||||||||||||||
| 9 | 0 | return $class->next::method($group => map lc, @cols); | |||||||||||||||||||
| 10 | } | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | ▶ | sub add_columns { | ||||||||||||||||||
|
Subroutine
add_columns: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 13 | 0 | my ($class, @cols) = @_; | |||||||||||||||||||
| 14 | 0 | return $class->result_source_instance->add_columns(map lc, @cols); | |||||||||||||||||||
| 15 | } | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 0 | ▶ | sub has_a { | ||||||||||||||||||
|
Subroutine
has_a: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 18 | 0 | my($self, $col, @rest) = @_; | |||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 0 | $self->_declare_has_a(lc $col, @rest); | |||||||||||||||||||
| 21 | 0 | $self->_mk_inflated_column_accessor($col); | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | return 1; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | ▶ | sub has_many { | ||||||||||||||||||
|
Subroutine
has_many: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 27 | 0 | my ($class, $rel, $f_class, $f_key, @rest) = @_; | |||||||||||||||||||
| 28 | 0 | ▶ | return $class->next::method( | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$f_key || ''
MC/DC0%0/1
$f_key || ''
$f_key
Truth table0%0/2
A
A= $f_key
| |||||||||||||||||||||
| 29 | $rel, | ||||||||||||||||||||
| 30 | $f_class, | ||||||||||||||||||||
| 31 | (ref($f_key) ? | ||||||||||||||||||||
| 32 | $f_key : | ||||||||||||||||||||
| 33 | lc($f_key||'') | ||||||||||||||||||||
| 34 | ), | ||||||||||||||||||||
| 35 | @rest | ||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 0 | ▶ | sub get_inflated_column { | ||||||||||||||||||
|
Subroutine
get_inflated_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 40 | 0 | my ($class, $get, @rest) = @_; | |||||||||||||||||||
| 41 | 0 | return $class->next::method(lc($get), @rest); | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 0 | ▶ | sub store_inflated_column { | ||||||||||||||||||
|
Subroutine
store_inflated_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 45 | 0 | my ($class, $set, @rest) = @_; | |||||||||||||||||||
| 46 | 0 | return $class->next::method(lc($set), @rest); | |||||||||||||||||||
| 47 | } | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 0 | ▶ | sub set_inflated_column { | ||||||||||||||||||
|
Subroutine
set_inflated_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 50 | 0 | my ($class, $set, @rest) = @_; | |||||||||||||||||||
| 51 | 0 | return $class->next::method(lc($set), @rest); | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | ▶ | sub get_column { | ||||||||||||||||||
|
Subroutine
get_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 55 | 0 | my ($class, $get, @rest) = @_; | |||||||||||||||||||
| 56 | 0 | return $class->next::method(lc($get), @rest); | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 0 | ▶ | sub set_column { | ||||||||||||||||||
|
Subroutine
set_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 60 | 0 | my ($class, $set, @rest) = @_; | |||||||||||||||||||
| 61 | 0 | return $class->next::method(lc($set), @rest); | |||||||||||||||||||
| 62 | } | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | 0 | ▶ | sub store_column { | ||||||||||||||||||
|
Subroutine
store_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 65 | 0 | my ($class, $set, @rest) = @_; | |||||||||||||||||||
| 66 | 0 | return $class->next::method(lc($set), @rest); | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | 0 | ▶ | sub find_column { | ||||||||||||||||||
|
Subroutine
find_column: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 70 | 0 | my ($class, $col) = @_; | |||||||||||||||||||
| 71 | 0 | return $class->next::method(lc($col)); | |||||||||||||||||||
| 72 | } | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | # _build_query | ||||||||||||||||||||
| 75 | # | ||||||||||||||||||||
| 76 | # Build a query hash for find, et al. Overrides Retrieve::_build_query. | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 0 | ▶ | sub _build_query { | ||||||||||||||||||
|
Subroutine
_build_query: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 79 | 0 | my ($self, $query) = @_; | |||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | 0 | my %new_query; | |||||||||||||||||||
| 82 | 0 | $new_query{lc $_} = $query->{$_} for keys %$query; | |||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 0 | return \%new_query; | |||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 0 | ▶ | sub _deploy_accessor { | ||||||||||||||||||
|
Subroutine
_deploy_accessor: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 88 | 0 | my($class, $name, $accessor) = @_; | |||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | 0 | ▶ | return if $class->_has_custom_accessor($name); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 0 | $class->next::method(lc $name => $accessor); | |||||||||||||||||||
| 93 | 0 | return $class->next::method($name => $accessor); | |||||||||||||||||||
| 94 | } | ||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 98 | 0 | my ($class, $attrs, @rest) = @_; | |||||||||||||||||||
| 99 | 0 | my %att; | |||||||||||||||||||
| 100 | 0 | $att{lc $_} = $attrs->{$_} for keys %$attrs; | |||||||||||||||||||
| 101 | 0 | return $class->next::method(\%att, @rest); | |||||||||||||||||||
| 102 | } | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 2 | 1; | |||||||||||||||||||