Revision 1d96e961
Von Sven Schöling vor mehr als 4 Jahren hinzugefügt
SL/Helper/Inventory.pm | ||
---|---|---|
for my $with_object (listify($params{with_objects})) {
|
||
Carp::croak("unknown with_object $with_object") if !exists $with_objects{$with_object};
|
||
|
||
if (my $manager = $with_objects{$with_object}) {
|
||
my $slot = $slots{$with_object};
|
||
next if !(my @ids = map { $_->{$slot} } @$results);
|
||
my $objects = $manager->get_all(query => [ id => \@ids ]);
|
||
my %objects_by_id = map { $_->id => $_ } @$objects;
|
||
|
||
$_->{$with_object} = $objects_by_id{$_->{$slot}} for @$results;
|
||
} else {
|
||
# need to fetch all partitions
|
||
}
|
||
my $manager = $with_objects{$with_object};
|
||
my $slot = $slots{$with_object};
|
||
next if !(my @ids = map { $_->{$slot} } @$results);
|
||
my $objects = $manager->get_all(query => [ id => \@ids ]);
|
||
my %objects_by_id = map { $_->id => $_ } @$objects;
|
||
|
||
$_->{$with_object} = $objects_by_id{$_->{$slot}} for @$results;
|
||
}
|
||
}
|
||
|
Auch abrufbar als: Unified diff
Inventory: with_objects cleanup