Revision 41536780
Von Sven Schöling vor fast 7 Jahren hinzugefügt
SL/DB/MakeModel.pm | ||
---|---|---|
6 | 6 |
use strict; |
7 | 7 |
|
8 | 8 |
use SL::DB::MetaSetup::MakeModel; |
9 |
use SL::DB::Manager::MakeModel; |
|
9 | 10 |
use SL::DB::Helper::ActsAsList (column_name => 'sortorder', group_by => [ qw(parts_id) ]); |
10 | 11 |
|
11 | 12 |
__PACKAGE__->meta->initialize; |
12 | 13 |
|
13 |
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. |
|
14 |
__PACKAGE__->meta->make_manager_class; |
|
15 |
|
|
16 | 14 |
1; |
SL/DB/Manager/MakeModel.pm | ||
---|---|---|
1 |
package SL::DB::Manager::MakeModel; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use SL::DB::Helper::Manager; |
|
6 |
use SL::DB::Helper::Sorted; |
|
7 |
use SL::DB::Helper::Paginated; |
|
8 |
use SL::DB::Helper::Filtered; |
|
9 |
use base qw(SL::DB::Helper::Manager); |
|
10 |
|
|
11 |
use Carp; |
|
12 |
use SL::DBUtils; |
|
13 |
use SL::MoreCommon qw(listify); |
|
14 |
|
|
15 |
sub object_class { 'SL::DB::MakeModel' } |
|
16 |
|
|
17 |
__PACKAGE__->make_manager_methods; |
|
18 |
|
|
19 |
sub _sort_spec { |
|
20 |
( |
|
21 |
default => [ 'sortorder', 1 ], |
|
22 |
columns => { |
|
23 |
SIMPLE => 'ALL', |
|
24 |
}, |
|
25 |
nulls => {}, |
|
26 |
); |
|
27 |
} |
|
28 |
|
|
29 |
1; |
|
30 |
__END__ |
Auch abrufbar als: Unified diff
Makemodel Manager mit _sort_spec