1 package DBIx::Class::AccessorGroup;
6 use base qw( DBIx::Class::MethodAttributes Class::Accessor::Grouped );
8 use Scalar::Util 'blessed';
9 use DBIx::Class::_Util 'fail_on_internal_call';
13 DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
14 shift->mk_classaccessor(@_);
17 sub mk_classaccessor {
19 $self->mk_group_accessors('inherited', $_[0]);
21 ? $self->set_inherited(@_)
22 : ( DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call )
26 sub get_component_class {
27 my $class = $_[0]->get_inherited($_[1]);
33 # inherited CAG can't be set to undef effectively, so people may use ''
36 # It's already an object, just go for it.
37 ! defined blessed $class
39 ! ${"${class}::__LOADED__BY__DBIC__CAG__COMPONENT_CLASS__"}
41 $_[0]->ensure_class_loaded($class);
43 ${"${class}::__LOADED__BY__DBIC__CAG__COMPONENT_CLASS__"}
44 = do { \(my $anon = 'loaded') };
50 sub set_component_class {
51 $_[0]->set_inherited($_[1], $_[2]);
53 # trigger a load for the case of $foo->component_accessor("bar")->new
54 $_[0]->get_component_class($_[1])
62 DBIx::Class::AccessorGroup - See Class::Accessor::Grouped
68 This class now exists in its own right on CPAN as Class::Accessor::Grouped
70 =head1 FURTHER QUESTIONS?
72 Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
74 =head1 COPYRIGHT AND LICENSE
76 This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
77 by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
78 redistribute it and/or modify it under the same terms as the
79 L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.