X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FWarehouse.pm;h=8345709da3a30346e5122a23834e33459edd22cd;hb=ce73964f91267ab5eecb2832765efbb3752c2a59;hp=0557976f39349137ccaaf2b728f2298b69db188a;hpb=117fefacdfaf457a502b32bae2f0e10fd0e11414;p=kivitendo-erp.git diff --git a/SL/DB/Warehouse.pm b/SL/DB/Warehouse.pm index 0557976f3..8345709da 100644 --- a/SL/DB/Warehouse.pm +++ b/SL/DB/Warehouse.pm @@ -1,15 +1,11 @@ -# 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::Warehouse; use strict; use SL::DB::MetaSetup::Warehouse; +use SL::DB::Manager::Warehouse; use SL::DB::Helper::ActsAsList; -__PACKAGE__->meta->make_manager_class; - __PACKAGE__->meta->add_relationship( bins => { type => 'one to many', @@ -18,13 +14,14 @@ __PACKAGE__->meta->add_relationship( } ); -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -#__PACKAGE__->meta->make_manager_class; - __PACKAGE__->meta->initialize; +sub bins_sorted { + return [ sort { $a->id <=> $b->id } @{ shift()->bins || [] } ]; +} + sub first_bin { - return shift()->bins->[0]; + return shift()->bins_sorted->[0]; } 1;