From: Moritz Bunkus Date: Thu, 29 Dec 2011 13:07:45 +0000 (+0100) Subject: Manager-Model für Unit-DB-Model mit Sortierfunktion hinzufügen X-Git-Tag: release-2.7.0beta1~109^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4c9d45bf6dc8697327cc6e49f94c56426e67354f;p=kivitendo-erp.git Manager-Model für Unit-DB-Model mit Sortierfunktion hinzufügen --- diff --git a/SL/DB/Manager/Unit.pm b/SL/DB/Manager/Unit.pm new file mode 100644 index 000000000..8b3c138a8 --- /dev/null +++ b/SL/DB/Manager/Unit.pm @@ -0,0 +1,21 @@ +package SL::DB::Manager::Unit; + +use strict; + +use SL::DB::Helper::Manager; +use base qw(SL::DB::Helper::Manager); + +use SL::DB::Helper::Sorted; + +sub object_class { 'SL::DB::Unit' } + +__PACKAGE__->make_manager_methods; + +sub _sort_spec { + return ( default => [ 'sortkey', 1 ], + columns => { SIMPLE => 'ALL', + name => 'lower(name)', + }); +} + +1; diff --git a/SL/DB/Unit.pm b/SL/DB/Unit.pm index 55a190b24..54b104d4f 100644 --- a/SL/DB/Unit.pm +++ b/SL/DB/Unit.pm @@ -1,14 +1,9 @@ -# 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::Unit; use strict; use SL::DB::MetaSetup::Unit; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; +use SL::DB::Manager::Unit; __PACKAGE__->meta->add_relationships( base => {