From 476b6d40310951004704374a3f248b35ef2ada3f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 3 May 2011 17:59:51 +0200 Subject: [PATCH] =?utf8?q?Manager-Klasse=20f=C3=BCr=20Customer?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Customer.pm | 1 - SL/DB/Manager/Customer.pm | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 SL/DB/Manager/Customer.pm diff --git a/SL/DB/Customer.pm b/SL/DB/Customer.pm index c2c436dfd..186ad9750 100644 --- a/SL/DB/Customer.pm +++ b/SL/DB/Customer.pm @@ -35,7 +35,6 @@ __PACKAGE__->meta->add_relationship( }, ); -__PACKAGE__->meta->make_manager_class; __PACKAGE__->meta->initialize; __PACKAGE__->before_save('_before_save_set_customernumber'); diff --git a/SL/DB/Manager/Customer.pm b/SL/DB/Manager/Customer.pm new file mode 100644 index 000000000..0d62fe8f2 --- /dev/null +++ b/SL/DB/Manager/Customer.pm @@ -0,0 +1,21 @@ +package SL::DB::Manager::Customer; + +use strict; + +use SL::DB::Helper::Manager; +use base qw(SL::DB::Helper::Manager); + +use SL::DB::Helper::Sorted; + +sub object_class { 'SL::DB::Customer' } + +__PACKAGE__->make_manager_methods; + +sub _sort_spec { + return ( default => [ 'name', 1 ], + columns => { SIMPLE => 'ALL', + map { ( $_ => "lower(customer.$_)" ) } qw(customernumber vendornumber name contact phone fax email street taxnumber business invnumber ordnumber quonumber) + }); +} + +1; -- 2.20.1