1 package DBIx::Class::ResultSetManager;
4 use base 'DBIx::Class';
8 warn "DBIx::Class::ResultSetManager never left experimental status and
9 has now been DEPRECATED. This module will be deleted in 09000 so please
10 migrate any and all code using it to explicit resultset classes using either
11 __PACKAGE__->resultset_class(...) calls or by switching from using
12 DBIx::Class::Schema->load_classes() to load_namespaces() and creating
13 appropriate My::Schema::ResultSet::* classes for it to pick up.";
17 DBIx::Class::ResultSetManager - scheduled for deletion in 09000
21 DBIx::Class::ResultSetManager never left experimental status and
22 has now been DEPRECATED. This module will be deleted in 09000 so please
23 migrate any and all code using it to explicit resultset classes using either
24 __PACKAGE__->resultset_class(...) calls or by switching from using
25 DBIx::Class::Schema->load_classes() to load_namespaces() and creating
26 appropriate My::Schema::ResultSet::* classes for it to pick up.";
30 __PACKAGE__->mk_classdata($_)
31 for qw/ base_resultset_class table_resultset_class_suffix /;
32 __PACKAGE__->base_resultset_class('DBIx::Class::ResultSet');
33 __PACKAGE__->table_resultset_class_suffix('::_resultset');
36 my ($self,@rest) = @_;
37 my $ret = $self->next::method(@rest);
39 $self->_register_attributes;
40 $self->_register_resultset_class;
45 sub load_resultset_components {
46 my ($self,@comp) = @_;
47 my $resultset_class = $self->_setup_resultset_class;
48 $resultset_class->load_components(@comp);
51 sub _register_attributes {
53 my $cache = $self->_attr_cache;
54 return if keys %$cache == 0;
56 foreach my $meth (keys %{ { map
59 { Package::Stash->new($_)->list_all_symbols("CODE") }
60 @{ mro::get_linear_isa( ref $self || $self ) }
62 # *DO NOT* rely on P::S returning crefs in reverse mro order
63 # but instead ask the mro to redo the lookup
64 # This codepath is extremely old, miht as well keep it running
65 # as-is with no room for surprises
66 my $attrs = $cache->{$self->can($meth)};
68 if ($attrs->[0] eq 'ResultSet') {
70 my $resultset_class = $self->_setup_resultset_class;
71 my $name = join '::',$resultset_class, $meth;
72 *$name = Sub::Name::subname $name, $self->can($meth);
73 delete ${"${self}::"}{$meth};
78 sub _setup_resultset_class {
80 my $resultset_class = $self . $self->table_resultset_class_suffix;
82 unless (@{"$resultset_class\::ISA"}) {
83 @{"$resultset_class\::ISA"} = ($self->base_resultset_class);
85 return $resultset_class;
88 sub _register_resultset_class {
90 my $resultset_class = $self . $self->table_resultset_class_suffix;
92 if (@{"$resultset_class\::ISA"}) {
93 $self->result_source_instance->resultset_class($resultset_class);
95 $self->result_source_instance->resultset_class
96 ($self->base_resultset_class);
100 =head1 FURTHER QUESTIONS?
102 Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
104 =head1 COPYRIGHT AND LICENSE
106 This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
107 by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
108 redistribute it and/or modify it under the same terms as the
109 L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.