Standard-Sortierung für Language-Model
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 12 May 2011 09:32:26 +0000 (11:32 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 12 May 2011 09:32:26 +0000 (11:32 +0200)
Conflicts:

SL/Controller/DeliveryPeriod.pm
SL/Controller/DeliveryTerm.pm

SL/DB/Language.pm
SL/DB/Manager/Language.pm [new file with mode: 0644]

index abfdebc..3248f38 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::Language;
 
 use strict;
 
 use SL::DB::MetaSetup::Language;
-
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
+use SL::DB::Manager::Language;
 
 1;
diff --git a/SL/DB/Manager/Language.pm b/SL/DB/Manager/Language.pm
new file mode 100644 (file)
index 0000000..db0d29a
--- /dev/null
@@ -0,0 +1,21 @@
+package SL::DB::Manager::Language;
+
+use strict;
+
+use SL::DB::Helper::Manager;
+use base qw(SL::DB::Helper::Manager);
+
+use SL::DB::Helper::Sorted;
+
+sub object_class { 'SL::DB::Language' }
+
+__PACKAGE__->make_manager_methods;
+
+sub _sort_spec {
+  return ( default => [ 'description', 1 ],
+           columns => { SIMPLE => 'ALL',
+                        map { ( $_ => "lower(language.${_})" ) } qw(description template_code article_code),
+                      });
+}
+
+1;