| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Ado::Model::Groups;    #A table/row class | 
| 2 | 23 |  |  | 23 |  | 8118 | use 5.010001; | 
|  | 23 |  |  |  |  | 71 |  | 
| 3 | 23 |  |  | 23 |  | 115 | use strict; | 
|  | 23 |  |  |  |  | 41 |  | 
|  | 23 |  |  |  |  | 400 |  | 
| 4 | 23 |  |  | 23 |  | 97 | use warnings; | 
|  | 23 |  |  |  |  | 40 |  | 
|  | 23 |  |  |  |  | 497 |  | 
| 5 | 23 |  |  | 23 |  | 96 | use utf8; | 
|  | 23 |  |  |  |  | 40 |  | 
|  | 23 |  |  |  |  | 95 |  | 
| 6 | 23 |  |  | 23 |  | 512 | use parent qw(Ado::Model); | 
|  | 23 |  |  |  |  | 77 |  | 
|  | 23 |  |  |  |  | 117 |  | 
| 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__ |