| 1 | package # hide from PAUSE | ||||||||||
| 2 | DBIx::Class::CDBICompat::GetSet; | ||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | #use base qw/Class::Accessor/; | ||||||||||
| 8 | |||||||||||
| 9 | sub get { | ||||||||||
| 10 | 0 | ▶ | my ($self, @cols) = @_; | ||||||||
|
Subroutine
get: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 11 | 0 | ▶ | if (@cols > 1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | return map { $self->get_column($_) } @cols; | |||||||||
| 13 | } else { | ||||||||||
| 14 | 0 | return $self->get_column($_[1]); | |||||||||
| 15 | } | ||||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | sub set { | ||||||||||
| 19 | 0 | ▶ | my($self, %data) = @_; | ||||||||
|
Subroutine
set: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 20 | |||||||||||
| 21 | # set_columns() is going to do a string comparison before setting. | ||||||||||
| 22 | # This breaks on DateTime objects (whose comparison is arguably broken) | ||||||||||
| 23 | # so we stringify anything first. | ||||||||||
| 24 | 0 | for my $key (keys %data) { | |||||||||
| 25 | 0 | ▶ | next unless ref $data{$key}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | $data{$key} = "$data{$key}"; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | return shift->set_columns(\%data); | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 1 | 1; | |||||||||