Revision history for DBIx::Class
0.07003 2006-XX-XX XX:XX:XX
+ - Tweaks to resultset to allow inflate_result to return an array
- Fix UTF8Columns to work under Perl <= 5.8.0
- Fix up new_result in ResultSet to avoid alias-related bugs
- Made new/update/find handle 'single' rel accessor correctly
$attrs->{where}, $attrs
);
- return (@data ? $self->_construct_object(@data) : ());
+ return (@data ? ($self->_construct_object(@data))[0] : ());
}
# _is_unique_query
$self->{all_cache_position} = 1;
return ($self->all)[0];
}
+ if ($self->{stashed_objects}) {
+ my $obj = shift(@{$self->{stashed_objects}});
+ delete $self->{stashed_objects} unless @{$self->{stashed_objects}};
+ }
my @row = (
exists $self->{stashed_row}
? @{delete $self->{stashed_row}}
: $self->cursor->next
);
return unless (@row);
- return $self->_construct_object(@row);
+ my ($row, @more) = $self->_construct_object(@row);
+ $self->{stashed_objects} = \@more if @more;
+ return $row;
}
sub _construct_object {
my ($self, @row) = @_;
my $info = $self->_collapse_result($self->{_attrs}{as}, \@row);
- my $new = $self->result_class->inflate_result($self->result_source, @$info);
- $new = $self->{_attrs}{record_filter}->($new)
+ my @new = $self->result_class->inflate_result($self->result_source, @$info);
+ @new = $self->{_attrs}{record_filter}->(@new)
if exists $self->{_attrs}{record_filter};
- return $new;
+ return @new;
}
sub _collapse_result {