Revision 476b6d40
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/DB/Customer.pm | ||
---|---|---|
35 | 35 |
}, |
36 | 36 |
); |
37 | 37 |
|
38 |
__PACKAGE__->meta->make_manager_class; |
|
39 | 38 |
__PACKAGE__->meta->initialize; |
40 | 39 |
|
41 | 40 |
__PACKAGE__->before_save('_before_save_set_customernumber'); |
SL/DB/Manager/Customer.pm | ||
---|---|---|
1 |
package SL::DB::Manager::Customer; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use SL::DB::Helper::Manager; |
|
6 |
use base qw(SL::DB::Helper::Manager); |
|
7 |
|
|
8 |
use SL::DB::Helper::Sorted; |
|
9 |
|
|
10 |
sub object_class { 'SL::DB::Customer' } |
|
11 |
|
|
12 |
__PACKAGE__->make_manager_methods; |
|
13 |
|
|
14 |
sub _sort_spec { |
|
15 |
return ( default => [ 'name', 1 ], |
|
16 |
columns => { SIMPLE => 'ALL', |
|
17 |
map { ( $_ => "lower(customer.$_)" ) } qw(customernumber vendornumber name contact phone fax email street taxnumber business invnumber ordnumber quonumber) |
|
18 |
}); |
|
19 |
} |
|
20 |
|
|
21 |
1; |
Auch abrufbar als: Unified diff
Manager-Klasse für Customer