Makemodel Manager mit _sort_spec
authorSven Schöling <s.schoeling@linet-services.de>
Mon, 29 Jan 2018 16:52:57 +0000 (17:52 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Mon, 29 Jan 2018 16:57:38 +0000 (17:57 +0100)
SL/DB/MakeModel.pm
SL/DB/Manager/MakeModel.pm [new file with mode: 0644]

index f94cd0a..fdc50bc 100644 (file)
@@ -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 (file)
index 0000000..2c6f603
--- /dev/null
@@ -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__