From: Bernd Bleßmann Date: Mon, 27 Nov 2017 17:08:52 +0000 (+0100) Subject: Inventur: Manager-Klasse für Inventory (f. sorting/paginating) X-Git-Tag: release-3.5.4~536 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6c59b08afa062f17a487910125809095fa3fb684;p=kivitendo-erp.git Inventur: Manager-Klasse für Inventory (f. sorting/paginating) --- diff --git a/SL/DB/Inventory.pm b/SL/DB/Inventory.pm index b8f28a37b..a463db5c6 100644 --- a/SL/DB/Inventory.pm +++ b/SL/DB/Inventory.pm @@ -6,12 +6,10 @@ package SL::DB::Inventory; use strict; use SL::DB::MetaSetup::Inventory; +use SL::DB::Manager::Inventory; __PACKAGE__->meta->initialize; -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - # part accessor is badly named sub part { goto &parts; diff --git a/SL/DB/Manager/Inventory.pm b/SL/DB/Manager/Inventory.pm new file mode 100644 index 000000000..030a386d0 --- /dev/null +++ b/SL/DB/Manager/Inventory.pm @@ -0,0 +1,28 @@ +package SL::DB::Manager::Inventory; + +use strict; + +use SL::DB::Helper::Manager; +use base qw(SL::DB::Helper::Manager); + +use SL::DB::Helper::Filtered; +use SL::DB::Helper::Paginated; +use SL::DB::Helper::Sorted; + +sub object_class { 'SL::DB::Inventory' } + +__PACKAGE__->make_manager_methods; + +sub _sort_spec { + return ( + default => [ 'itime', 1 ], + columns => { + SIMPLE => 'ALL', + }); +} + +sub default_objects_per_page { + 20; +} + +1;