| Issue 45: | Add the ability to filter relationships | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Please add the ability to filter relationships with a where() clause or
similar.
Example:
my $invoice_lines =
$dbh->invoice->get($invoice_id)->invoice_items->where(status => 'active');
Currently, you have to code it like this:
my $invoice = $dbh->invoice->get($invoice_id);
my $invoice_lines = $invoice->invoice_items;
my @good;
while (my $line = $invoice_lines->next()) {
next unless ($line->status eq 'active');
# other processing here...
}
As you can see, not only is that very inefficient to code, but it requires
that you select and fetch ALL records and then filter in Perl. It would be
far superior to only fetch the records you wanted, based on a where()
clause or other filtering mechanism.
Sep 6, 2010
#1
dan...@drjays.com
Labels:
fixed_in_1.1
Sep 7, 2010
Fixed in 1.1. Please verify
Status:
Fixed
|