1 package DBIx::Class::ResultSource::Table::Cached;
3 use Scalar::Util qw/weaken/;
5 use base qw/DBIx::Class/;
6 __PACKAGE__->load_components(qw/ResultSource::Table/);
10 return $self->{_resultset} ||= do {
11 my $rs = $self->next::method;
12 weaken $rs->result_source;
23 DBIx::Class::ResultSource::Table::Cached - Table object that caches its own resultset
27 This is a modified version of L<DBIx::Class::ResultSource::Table> that caches
28 its resultset, so when you call $schema->resultset('Foo') it does not
29 re-instantiate the resultset each time. In pathological cases this may not
30 work correctly, e.g. if you change important attributes of the result source
35 David Kamholz <dkamholz@cpan.org>
39 You may distribute this code under the same terms as Perl itself.