/[A3C]/lib/A3C/Record.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/Record.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 207 by dpavlin, Fri Apr 11 16:50:37 2008 UTC revision 208 by dpavlin, Thu Jun 19 21:24:26 2008 UTC
# Line 5  use warnings; Line 5  use warnings;
5    
6  use base 'Jifty::Record';  use base 'Jifty::Record';
7    
8    use Data::Dump qw/dump/;
9    
10  =head1 NAME  =head1 NAME
11    
12  Custom Record class for A3C  Custom Record class for A3C
# Line 58  sub load_or_create { Line 60  sub load_or_create {
60          return ( $id, $msg );          return ( $id, $msg );
61  }  }
62    
63    =head2 create
64    
65    Serialize ARRAY values into single scalar separated by magic C<< <*> >> marker
66    
67    =cut
68    
69    sub create {
70            #warn "# create",dump(@_);
71            my $self = shift;
72            my %data = @_ or die "no data?";
73            foreach my $col ( keys %data ) {
74                    #warn "## ref($col)=",ref($col);
75                    $data{$col} = join(' <*> ', @{$data{$col}}) if ref( $data{$col} ) eq 'ARRAY';
76            }
77            #warn "## data = ",dump( %data );
78            $self->SUPER::create( %data );
79    }
80    
81    
82  1;  1;

Legend:
Removed from v.207  
changed lines
  Added in v.208

  ViewVC Help
Powered by ViewVC 1.1.26