Commit | Line | Data |
---|---|---|
fe5d862b | 1 | package DBIx::Class::AccessorGroup; |
2 | ||
12bbb339 | 3 | use strict; |
4 | use warnings; | |
5 | ||
73281318 | 6 | use base qw/Class::Accessor::Grouped/; |
91fe73bc | 7 | use Scalar::Util qw/weaken blessed/; |
0d374214 | 8 | use namespace::clean; |
701da8c4 | 9 | |
0d374214 | 10 | my $successfully_loaded_components; |
db29433c | 11 | |
12 | sub get_component_class { | |
13 | my $class = $_[0]->get_inherited($_[1]); | |
0d374214 | 14 | |
91fe73bc | 15 | # It's already an object, just go for it. |
16 | return $class if blessed $class; | |
17 | ||
0d374214 | 18 | if (defined $class and ! $successfully_loaded_components->{$class} ) { |
db29433c | 19 | $_[0]->ensure_class_loaded($class); |
0d374214 | 20 | |
21 | no strict 'refs'; | |
22 | $successfully_loaded_components->{$class} | |
23 | = ${"${class}::__LOADED__BY__DBIC__CAG__COMPONENT_CLASS__"} | |
24 | = do { \(my $anon = 'loaded') }; | |
25 | weaken($successfully_loaded_components->{$class}); | |
db29433c | 26 | } |
0d374214 | 27 | |
db29433c | 28 | $class; |
29 | }; | |
30 | ||
31 | sub set_component_class { | |
32 | shift->set_inherited(@_); | |
33 | } | |
34 | ||
fe0e9f67 | 35 | 1; |
36 | ||
75d07914 | 37 | =head1 NAME |
34d52be2 | 38 | |
73281318 | 39 | DBIx::Class::AccessorGroup - See Class::Accessor::Grouped |
34d52be2 | 40 | |
41 | =head1 SYNOPSIS | |
42 | ||
43 | =head1 DESCRIPTION | |
44 | ||
73281318 | 45 | This class now exists in its own right on CPAN as Class::Accessor::Grouped |
fc969005 | 46 | |
a2bd3796 | 47 | =head1 FURTHER QUESTIONS? |
34d52be2 | 48 | |
a2bd3796 | 49 | Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>. |
34d52be2 | 50 | |
a2bd3796 | 51 | =head1 COPYRIGHT AND LICENSE |
34d52be2 | 52 | |
a2bd3796 | 53 | This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE> |
54 | by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can | |
55 | redistribute it and/or modify it under the same terms as the | |
56 | L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>. | |
34d52be2 | 57 | |
58 | =cut |