Cleanup a bit
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Encoded.pm
CommitLineData
f1417dab 1package # hide from PAUSE
2 DBICTest::Schema::Encoded;
3
660cf1be 4use base qw/DBICTest::BaseResult/;
f1417dab 5
6use strict;
7use warnings;
8
9__PACKAGE__->table('encoded');
10__PACKAGE__->add_columns(
11 'id' => {
12 data_type => 'integer',
13 is_auto_increment => 1
14 },
15 'encoded' => {
16 data_type => 'varchar',
17 size => 100,
18 is_nullable => 1,
19 },
20);
21
22__PACKAGE__->set_primary_key('id');
23
24sub set_column {
25 my ($self, $col, $value) = @_;
26 if( $col eq 'encoded' ){
27 $value = reverse split '', $value;
28 }
29 $self->next::method($col, $value);
30}
31
32sub new {
33 my($self, $attr, @rest) = @_;
34 $attr->{encoded} = reverse split '', $attr->{encoded}
35 if defined $attr->{encoded};
36 return $self->next::method($attr, @rest);
37}
38
391;