Sortierfunktion für Pricegroup-Model
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 3 Mar 2011 10:06:53 +0000 (11:06 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 3 Mar 2011 10:07:11 +0000 (11:07 +0100)
SL/DB/Manager/Pricegroup.pm [new file with mode: 0644]
SL/DB/Pricegroup.pm

diff --git a/SL/DB/Manager/Pricegroup.pm b/SL/DB/Manager/Pricegroup.pm
new file mode 100644 (file)
index 0000000..6da4f21
--- /dev/null
@@ -0,0 +1,21 @@
+package SL::DB::Manager::Pricegroup;
+
+use strict;
+
+use SL::DB::Helper::Manager;
+use base qw(SL::DB::Helper::Manager);
+
+use SL::DB::Helper::Sorted;
+
+sub object_class { 'SL::DB::Pricegroup' }
+
+__PACKAGE__->make_manager_methods;
+
+sub _sort_spec {
+  return ( default => [ 'pricegroup', 1 ],
+           columns => { SIMPLE => 'ALL',
+                        map { ( $_ => "lower(pricegroup.${_})" ) } qw(pricegroup),
+                      });
+}
+
+1;
index 8c9c372..329dc41 100644 (file)
@@ -1,13 +1,8 @@
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
 package SL::DB::Pricegroup;
 
 use strict;
 
 use SL::DB::MetaSetup::Pricegroup;
-
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
+use SL::DB::Manager::Pricegroup;
 
 1;