| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Ado::Model::Groups; #A table/row class |
|
2
|
23
|
|
|
23
|
|
13337
|
use 5.010001; |
|
|
23
|
|
|
|
|
76
|
|
|
3
|
23
|
|
|
23
|
|
114
|
use strict; |
|
|
23
|
|
|
|
|
32
|
|
|
|
23
|
|
|
|
|
485
|
|
|
4
|
23
|
|
|
23
|
|
98
|
use warnings; |
|
|
23
|
|
|
|
|
37
|
|
|
|
23
|
|
|
|
|
569
|
|
|
5
|
23
|
|
|
23
|
|
104
|
use utf8; |
|
|
23
|
|
|
|
|
33
|
|
|
|
23
|
|
|
|
|
136
|
|
|
6
|
23
|
|
|
23
|
|
618
|
use parent qw(Ado::Model); |
|
|
23
|
|
|
|
|
35
|
|
|
|
23
|
|
|
|
|
109
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
1
|
|
sub is_base_class { return 0 } |
|
9
|
|
|
|
|
|
|
my $TABLE_NAME = 'groups'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
1
|
|
sub TABLE { return $TABLE_NAME } |
|
12
|
0
|
|
|
0
|
1
|
|
sub PRIMARY_KEY { return 'id' } |
|
13
|
|
|
|
|
|
|
my $COLUMNS = ['id', 'name', 'description', 'created_by', 'changed_by', 'disabled']; |
|
14
|
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
1
|
|
sub COLUMNS { return $COLUMNS } |
|
16
|
|
|
|
|
|
|
my $ALIASES = {}; |
|
17
|
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
1
|
|
sub ALIASES { return $ALIASES } |
|
19
|
|
|
|
|
|
|
my $CHECKS = { |
|
20
|
|
|
|
|
|
|
'changed_by' => {'allow' => qr/(?^x:^-?\d{1,}$)/}, |
|
21
|
|
|
|
|
|
|
'disabled' => { |
|
22
|
|
|
|
|
|
|
'required' => 1, |
|
23
|
|
|
|
|
|
|
'defined' => 1, |
|
24
|
|
|
|
|
|
|
'allow' => qr/(?^x:^-?\d{1,1}$)/, |
|
25
|
|
|
|
|
|
|
'default' => '1' |
|
26
|
|
|
|
|
|
|
}, |
|
27
|
|
|
|
|
|
|
'name' => { |
|
28
|
|
|
|
|
|
|
'required' => 1, |
|
29
|
|
|
|
|
|
|
'defined' => 1, |
|
30
|
|
|
|
|
|
|
'allow' => qr/(?^x:^.{1,100}$)/ |
|
31
|
|
|
|
|
|
|
}, |
|
32
|
|
|
|
|
|
|
'id' => {'allow' => qr/(?^x:^-?\d{1,}$)/}, |
|
33
|
|
|
|
|
|
|
'description' => { |
|
34
|
|
|
|
|
|
|
'required' => 1, |
|
35
|
|
|
|
|
|
|
'defined' => 1, |
|
36
|
|
|
|
|
|
|
'allow' => qr/(?^x:^.{1,255}$)/ |
|
37
|
|
|
|
|
|
|
}, |
|
38
|
|
|
|
|
|
|
'created_by' => {'allow' => qr/(?^x:^-?\d{1,}$)/} |
|
39
|
|
|
|
|
|
|
}; |
|
40
|
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub CHECKS { return $CHECKS } |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__PACKAGE__->QUOTE_IDENTIFIERS(0); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#__PACKAGE__->BUILD;#build accessors during load |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#find and instantiate a group object by name |
|
48
|
|
|
|
|
|
|
sub by_name { |
|
49
|
0
|
|
|
0
|
1
|
|
state $sql = $_[0]->SQL('SELECT') . ' WHERE name=?'; |
|
50
|
0
|
|
|
|
|
|
return shift->query($sql, shift); |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
1; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |