/[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 54 by dpavlin, Tue Apr 1 19:27:06 2008 UTC revision 76 by dpavlin, Fri Apr 11 16:50:37 2008 UTC
# Line 13  Custom Record class for A3C Line 13  Custom Record class for A3C
13    
14  =head2 load_or_create  =head2 load_or_create
15    
16  Perform canonicalization on C<load_or_create>  Perform canonicalization on C<load_or_create> and loads subset of columns
17    (which hopfully are indexes in model for performance reasons).
18    
19  =cut  =cut
20    
# Line 24  sub load_or_create { Line 25  sub load_or_create {
25                  ( $self, $class ) = ( $class, undef );                  ( $self, $class ) = ( $class, undef );
26          } else {          } else {
27                  $self = $class->new();                  $self = $class->new();
28      }          }
29    
30          my %args = (@_);          my %args = (@_);
31    
# Line 35  sub load_or_create { Line 36  sub load_or_create {
36                  );                  );
37          }          }
38    
39          my ( $id, $msg ) = $self->load_by_cols(%args);          my %load_cols;
40    
41            if ( ref($self) eq Jifty->app_class('Model','Person') ) {
42    
43                    $load_cols{$_} = $args{$_} foreach ( qw/
44                            uid
45                            hrEduPersonUniqueID
46                            mail
47                    / );
48            
49            } else {
50                    %load_cols = %args;
51            }
52    
53            my ( $id, $msg ) = $self->load_by_cols(%load_cols);
54          unless ( $self->id ) {          unless ( $self->id ) {
55                  return $self->create(%args);                  return $self->create(%args);
56          }          }

Legend:
Removed from v.54  
changed lines
  Added in v.76

  ViewVC Help
Powered by ViewVC 1.1.26