From 41536780254166ea80f2741b3527eaf35ab00ad8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 29 Jan 2018 17:52:57 +0100 Subject: [PATCH] Makemodel Manager mit _sort_spec --- SL/DB/MakeModel.pm | 4 +--- SL/DB/Manager/MakeModel.pm | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 SL/DB/Manager/MakeModel.pm 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__ -- 2.20.1