Hi,
Is there a way to filter the objects returned by manager->get_objects further using a similar hash structure as an argument as needed by get_objects?
my $all_objs = $manager->get_objects(user_id => $user_id);
What I want:
my ($obj_1) = $manager->filter_objects($all_objs, {query => ['type' => 'obj_1'], sort => 'order', limit => 1}); # preventing another SQL query
What's working:
my $obj_1 = [ sort { $a->order <=> $b->order } grep $_->type eq 'obj_1', @$all_objs ]->[0];
For simple examples it works, but it get complicated when you try to apply limit, sort etc.
Thanks