From 4c9d45bf6dc8697327cc6e49f94c56426e67354f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 29 Dec 2011 14:07:45 +0100 Subject: [PATCH] =?utf8?q?Manager-Model=20f=C3=BCr=20Unit-DB-Model=20mit?= =?utf8?q?=20Sortierfunktion=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Manager/Unit.pm | 21 +++++++++++++++++++++ SL/DB/Unit.pm | 7 +------ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 SL/DB/Manager/Unit.pm 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 => { -- 2.20.1