use strict;
use warnings;
-use base qw/DBIx::Class/;
-use Scalar::Util qw/blessed/;
-use Sub::Name qw/subname/;
+use base 'DBIx::Class';
+use mro 'c3';
+
+use DBIx::Class::_Util qw( quote_sub fail_on_internal_call );
use namespace::clean;
__PACKAGE__->mk_group_accessors('inherited_ro_instance' => 'source_name');
-sub get_inherited_ro_instance { shift->get_inherited(@_) }
+sub get_inherited_ro_instance { $_[0]->get_inherited($_[1]) }
sub set_inherited_ro_instance {
- my $self = shift;
-
- $self->throw_exception ("Cannot set @{[shift]} on an instance")
- if blessed $self;
+ $_[0]->throw_exception ("Cannot set '$_[1]' on an instance")
+ if length ref $_[0];
- $self->set_inherited(@_);
+ $_[0]->set_inherited( $_[1], $_[2] );
}
}
}
-sub add_column { shift->add_columns(@_) }
+sub add_column {
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
+ shift->add_columns(@_)
+}
sub add_relationship {
# legacy resultset_class accessor, seems to be used by cdbi only
-sub iterator_class { shift->result_source_instance->resultset_class(@_) }
+sub iterator_class {
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
+ shift->result_source_instance->resultset_class(@_)
+}
for my $method_to_proxy (qw/
source_info
remove_columns
column_info
+ columns_info
column_info_from_storage
set_primary_key
primary_columns
- _pri_cols
+ sequence
add_unique_constraint
add_unique_constraints
relationship_info
has_relationship
/) {
- no strict qw/refs/;
- *{__PACKAGE__."::$method_to_proxy"} = subname $method_to_proxy => sub {
- shift->result_source_instance->$method_to_proxy (@_);
- };
+ quote_sub __PACKAGE__."::$method_to_proxy", sprintf( <<'EOC', $method_to_proxy );
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and DBIx::Class::_Util::fail_on_internal_call;
+ shift->result_source_instance->%s (@_);
+EOC
+
}
1;