From: Sven Schöling Date: Mon, 29 Jan 2018 16:52:57 +0000 (+0100) Subject: Makemodel Manager mit _sort_spec X-Git-Tag: release-3.5.4~489 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=41536780254166ea80f2741b3527eaf35ab00ad8;p=kivitendo-erp.git Makemodel Manager mit _sort_spec --- diff --git a/SL/DB/MakeModel.pm b/SL/DB/MakeModel.pm index f94cd0ab6..fdc50bc33 100644 --- a/SL/DB/MakeModel.pm +++ b/SL/DB/MakeModel.pm @@ -6,11 +6,9 @@ package SL::DB::MakeModel; use strict; use SL::DB::MetaSetup::MakeModel; +use SL::DB::Manager::MakeModel; use SL::DB::Helper::ActsAsList (column_name => 'sortorder', group_by => [ qw(parts_id) ]); __PACKAGE__->meta->initialize; -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - 1; diff --git a/SL/DB/Manager/MakeModel.pm b/SL/DB/Manager/MakeModel.pm new file mode 100644 index 000000000..2c6f603f7 --- /dev/null +++ b/SL/DB/Manager/MakeModel.pm @@ -0,0 +1,30 @@ +package SL::DB::Manager::MakeModel; + +use strict; + +use SL::DB::Helper::Manager; +use SL::DB::Helper::Sorted; +use SL::DB::Helper::Paginated; +use SL::DB::Helper::Filtered; +use base qw(SL::DB::Helper::Manager); + +use Carp; +use SL::DBUtils; +use SL::MoreCommon qw(listify); + +sub object_class { 'SL::DB::MakeModel' } + +__PACKAGE__->make_manager_methods; + +sub _sort_spec { + ( + default => [ 'sortorder', 1 ], + columns => { + SIMPLE => 'ALL', + }, + nulls => {}, + ); +} + +1; +__END__