1 package SL::DB::Warehouse;
5 use SL::DB::MetaSetup::Warehouse;
6 use SL::DB::Manager::Warehouse;
7 use SL::DB::Helper::ActsAsList;
9 __PACKAGE__->meta->add_relationship(
11 type => 'one to many',
12 class => 'SL::DB::Bin',
13 column_map => { id => 'warehouse_id' },
17 __PACKAGE__->meta->initialize;
20 return [ sort { $a->id <=> $b->id } @{ shift()->bins || [] } ];
24 return shift()->bins_sorted->[0];