'undef =>' isn't what one would want
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / AccessorGroup.pm
CommitLineData
fe5d862b 1package DBIx::Class::AccessorGroup;
2
12bbb339 3use strict;
4use warnings;
5
73281318 6use base qw/Class::Accessor::Grouped/;
91fe73bc 7use Scalar::Util qw/weaken blessed/;
0d374214 8use namespace::clean;
701da8c4 9
0d374214 10my $successfully_loaded_components;
db29433c 11
12sub 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
31sub set_component_class {
32 shift->set_inherited(@_);
33}
34
fe0e9f67 351;
36
75d07914 37=head1 NAME
34d52be2 38
73281318 39DBIx::Class::AccessorGroup - See Class::Accessor::Grouped
34d52be2 40
41=head1 SYNOPSIS
42
43=head1 DESCRIPTION
44
73281318 45This class now exists in its own right on CPAN as Class::Accessor::Grouped
fc969005 46
a2bd3796 47=head1 FURTHER QUESTIONS?
34d52be2 48
a2bd3796 49Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
34d52be2 50
a2bd3796 51=head1 COPYRIGHT AND LICENSE
34d52be2 52
a2bd3796 53This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
54by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
55redistribute it and/or modify it under the same terms as the
56L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
34d52be2 57
58=cut