| 1 | #!/bin/false | ||
| 2 | |||
| 3 | # Copyright (c) 2002 Craig Welch | ||
| 4 | # | ||
| 5 | # You may distribute under the terms of either the GNU General Public | ||
| 6 | # License or the Artistic License, as specified in the Perl README file. | ||
| 7 | |||
| 8 | package ObjectRowMapTest; | ||
| 9 | |||
| 10 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 1 | ▶ | use vars qw( @ISA ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 0 | ▶ | use ObjectRowMap; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 15 | push @ISA, 'ObjectRowMap'; | ||
| 16 | |||
| 17 | |||
| 18 | my $ormapProps; | ||
| 19 | if (!defined($ormapProps)) { | ||
| 20 | $ormapProps = { 'table'=>'test','keyFields'=>['login','uid'],'dbhConnectArgs'=>["DBI:Pg:dbname=ormaptest",'login','password',{'AutoCommit'=>0}],'persistFields'=>{'login'=>'','uid'=>'','password'=>'','gecos'=>''},'debug'=>0,'commitOnSave'=>1}; | ||
| 21 | } | ||
| 22 | |||
| 23 | sub ormapProperties { | ||
| 24 | return $ormapProps; | ||
| 25 | } | ||
| 26 | |||
| 27 | sub preSave_password { | ||
| 28 | my $self = shift; | ||
| 29 | my $pass = shift; | ||
| 30 | $pass .= "_SUPERENCRYPTED"; | ||
| 31 | return $pass; | ||
| 32 | } | ||
| 33 | |||
| 34 | sub postLoad_password { | ||
| 35 | my $self = shift; | ||
| 36 | my $pass = shift; | ||
| 37 | $pass =~ s/_SUPERENCRYPTED//; | ||
| 38 | return $pass; | ||
| 39 | } | ||
| 40 | |||
| 41 | sub get_uid { | ||
| 42 | my $self = shift; | ||
| 43 | my $uid = shift; | ||
| 44 | print STDERR "Get Intercepted uid $uid\n"; | ||
| 45 | return $uid; | ||
| 46 | } | ||
| 47 | |||
| 48 | sub set_uid { | ||
| 49 | my $self = shift; | ||
| 50 | my $uid = shift; | ||
| 51 | print STDERR "Set Intercepted uid $uid, adding 10 for kicks\n"; | ||
| 52 | $uid = $uid + 10; | ||
| 53 | return $uid; | ||
| 54 | } | ||
| 55 | |||
| 56 | |||