| 1 | package DBIO::Test::Schema::Encoded; | ||||||||||
| 2 | # ABSTRACT: Test result class for the encoded table | ||||||||||
| 3 | |||||||||||
| 4 | 256 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 256 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 256 | our $VERSION = '0.900007'; | |||||||||
| 8 | |||||||||||
| 9 | 256 | ▶ | use base qw/DBIO::Test::BaseResult/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 256 | __PACKAGE__->table('encoded'); | |||||||||
| 12 | 256 | __PACKAGE__->add_columns( | |||||||||
| 13 | 'id' => { | ||||||||||
| 14 | data_type => 'integer', | ||||||||||
| 15 | is_auto_increment => 1 | ||||||||||
| 16 | }, | ||||||||||
| 17 | 'encoded' => { | ||||||||||
| 18 | data_type => 'varchar', | ||||||||||
| 19 | size => 100, | ||||||||||
| 20 | is_nullable => 1, | ||||||||||
| 21 | }, | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | 256 | __PACKAGE__->set_primary_key('id'); | |||||||||
| 25 | |||||||||||
| 26 | 256 | __PACKAGE__->has_many (keyholders => 'DBIO::Test::Schema::Employee', 'encoded'); | |||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub set_column { | ||||||||
|
Subroutine
set_column: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 29 | 0 | my ($self, $col, $value) = @_; | |||||||||
| 30 | 0 | ▶ | if( $col eq 'encoded' ){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | $value = reverse split '', $value; | |||||||||
| 32 | } | ||||||||||
| 33 | 0 | $self->next::method($col, $value); | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 37 | 0 | my($self, $attr, @rest) = @_; | |||||||||
| 38 | $attr->{encoded} = reverse split '', $attr->{encoded} | ||||||||||
| 39 | 0 | ▶ | if defined $attr->{encoded}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | return $self->next::method($attr, @rest); | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 256 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||