line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SLOOPS::Tut::Person ; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1441
|
use base qw/Class::AutoAccess/ ; # for easy attribute access. |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
154
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# SLOOPS PART |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $PERSIST = { |
8
|
|
|
|
|
|
|
fields => { |
9
|
|
|
|
|
|
|
'firstName' => undef , # DEFAULT type will be used in database. |
10
|
|
|
|
|
|
|
'lastName' => undef |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
} ; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# END OF SLOOPS PART |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new{ |
17
|
0
|
|
|
0
|
0
|
|
my ($class) = @_ ; # A persistant class MUST implement a no parameters constructor ! |
18
|
0
|
|
|
|
|
|
my $self = { |
19
|
|
|
|
|
|
|
'firstName' => undef , |
20
|
|
|
|
|
|
|
'lastName' => undef , |
21
|
|
|
|
|
|
|
'non_perst' => undef # This attribute will not be persistent !! |
22
|
|
|
|
|
|
|
}; |
23
|
0
|
|
|
|
|
|
return bless $self, $class ; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |