Manager für PartsGroup mit sort_spec
authorG. Richardson <information@kivitendo-premium.de>
Sun, 7 Aug 2016 20:52:27 +0000 (22:52 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Tue, 22 Nov 2016 13:42:49 +0000 (14:42 +0100)
SL/DB/Manager/PartsGroup.pm [new file with mode: 0644]
SL/DB/PartsGroup.pm

diff --git a/SL/DB/Manager/PartsGroup.pm b/SL/DB/Manager/PartsGroup.pm
new file mode 100644 (file)
index 0000000..24e016c
--- /dev/null
@@ -0,0 +1,19 @@
+package SL::DB::Manager::PartsGroup;
+
+use strict;
+
+use SL::DB::Helper::Manager;
+use base qw(SL::DB::Helper::Manager);
+
+use SL::DB::Helper::Sorted;
+
+sub object_class { 'SL::DB::PartsGroup' }
+
+__PACKAGE__->make_manager_methods;
+
+sub _sort_spec {
+  return ( default => [ 'partsgroup', 1 ],
+           columns => { SIMPLE => 'ALL' });
+}
+
+1;
index ed3c164..f40c5de 100644 (file)
@@ -6,6 +6,7 @@ package SL::DB::PartsGroup;
 use strict;
 
 use SL::DB::MetaSetup::PartsGroup;
+use SL::DB::Manager::PartsGroup;
 
 __PACKAGE__->meta->add_relationship(
   custom_variable_configs => {
@@ -16,9 +17,6 @@ __PACKAGE__->meta->add_relationship(
 
 __PACKAGE__->meta->initialize;
 
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
-
 sub displayable_name {
   my $self = shift;