X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FIterator.pm;h=499583718fb230448a1d6ed3e02fe9e89d1eb8e0;hb=5e0eea3522876a30453af24097507198bbbc9409;hp=80e788ce1b8f910f6dd0ab48fd6ab6a6944f1e09;hpb=b24d86a1fbeb89083bc2eeeeb286d590ffea702a;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat/Iterator.pm b/lib/DBIx/Class/CDBICompat/Iterator.pm index 80e788c..4995837 100644 --- a/lib/DBIx/Class/CDBICompat/Iterator.pm +++ b/lib/DBIx/Class/CDBICompat/Iterator.pm @@ -3,6 +3,7 @@ package DBIx::Class::CDBICompat::Iterator; use strict; use warnings; +use base 'DBIx::Class'; =head1 NAME @@ -10,7 +11,7 @@ DBIx::Class::CDBICompat::Iterator - Emulates the extra behaviors of the Class::D =head1 SYNOPSIS -See DBIx::Class::CDBICompat for directions for use. +See DBIx::Class::CDBICompat for usage directions. =head1 DESCRIPTION @@ -25,16 +26,28 @@ The CDBI iterator returns true if there were any results, false otherwise. The sub _init_result_source_instance { my $class = shift; - + my $table = $class->next::method(@_); $table->resultset_class("DBIx::Class::CDBICompat::Iterator::ResultSet"); return $table; } +=head1 FURTHER QUESTIONS? + +Check the list of L. + +=head1 COPYRIGHT AND LICENSE +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. + +=cut -package DBIx::Class::CDBICompat::Iterator::ResultSet; +package # hide + DBIx::Class::CDBICompat::Iterator::ResultSet; use strict; use warnings; @@ -49,4 +62,16 @@ sub _bool { return $_[0]->count; } +sub _construct_results { + my $self = shift; + + my $rows = $self->next::method(@_); + + if (my $f = $self->_resolved_attrs->{record_filter}) { + $_ = $f->($_) for @$rows; + } + + return $rows; +} + 1;