1 package DBIx::Class::ResultSetManager;
4 use base 'DBIx::Class';
6 use DBIx::Class::_Util qw( set_subname describe_class_methods );
9 warn "DBIx::Class::ResultSetManager never left experimental status and
10 has now been DEPRECATED. This module will be deleted in 09000 so please
11 migrate any and all code using it to explicit resultset classes using either
12 __PACKAGE__->resultset_class(...) calls or by switching from using
13 DBIx::Class::Schema->load_classes() to load_namespaces() and creating
14 appropriate My::Schema::ResultSet::* classes for it to pick up.";
18 DBIx::Class::ResultSetManager - scheduled for deletion in 09000
22 DBIx::Class::ResultSetManager never left experimental status and
23 has now been DEPRECATED. This module will be deleted in 09000 so please
24 migrate any and all code using it to explicit resultset classes using either
25 __PACKAGE__->resultset_class(...) calls or by switching from using
26 DBIx::Class::Schema->load_classes() to load_namespaces() and creating
27 appropriate My::Schema::ResultSet::* classes for it to pick up.";
31 __PACKAGE__->mk_group_accessors(inherited => qw(
32 base_resultset_class table_resultset_class_suffix
34 __PACKAGE__->base_resultset_class('DBIx::Class::ResultSet');
35 __PACKAGE__->table_resultset_class_suffix('::_resultset');
38 my ($self,@rest) = @_;
39 my $ret = $self->next::method(@rest);
41 $self->_register_attributes;
42 $self->_register_resultset_class;
47 sub load_resultset_components {
48 my ($self,@comp) = @_;
49 my $resultset_class = $self->_setup_resultset_class;
50 $resultset_class->load_components(@comp);
53 sub _register_attributes {
55 my $cache = $self->_attr_cache;
56 return if keys %$cache == 0;
62 { $_->{attributes}{ResultSet} }
65 values %{ describe_class_methods( ref $self || $self )->{methods} }
67 # This codepath is extremely old, miht as well keep it running
68 # as-is with no room for surprises
70 my $resultset_class = $self->_setup_resultset_class;
71 my $name = join '::',$resultset_class, $meth;
72 *$name = set_subname $name, $self->can($meth);
73 delete ${"${self}::"}{$meth};
77 sub _setup_resultset_class {
79 my $resultset_class = $self . $self->table_resultset_class_suffix;
81 unless (@{"$resultset_class\::ISA"}) {
82 @{"$resultset_class\::ISA"} = ($self->base_resultset_class);
84 return $resultset_class;
87 sub _register_resultset_class {
89 my $resultset_class = $self . $self->table_resultset_class_suffix;
91 if (@{"$resultset_class\::ISA"}) {
92 $self->result_source_instance->resultset_class($resultset_class);
94 $self->result_source_instance->resultset_class
95 ($self->base_resultset_class);
99 =head1 FURTHER QUESTIONS?
101 Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
103 =head1 COPYRIGHT AND LICENSE
105 This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
106 by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
107 redistribute it and/or modify it under the same terms as the
108 L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.