use strict;
use warnings;
-use base qw/DBIx::Class::ResultSource::RowParser DBIx::Class/;
+use base 'DBIx::Class::ResultSource::RowParser';
+use mro 'c3';
use DBIx::Class::Carp;
-use DBIx::Class::_Util qw( UNRESOLVABLE_CONDITION dbic_internal_try );
+use DBIx::Class::_Util qw( UNRESOLVABLE_CONDITION dbic_internal_try fail_on_internal_call );
use SQL::Abstract 'is_literal_value';
use Devel::GlobalDestruction;
use Scalar::Util qw/blessed weaken isweak/;
+# FIXME - somehow breaks ResultSetManager, do not remove until investigated
+use DBIx::Class::ResultSet;
+
use namespace::clean;
__PACKAGE__->mk_group_accessors(simple => qw/
source_name name source_info
_ordered_columns _columns _primaries _unique_constraints
_relationships resultset_attributes
- column_info_from_storage
+ column_info_from_storage sqlt_deploy_callback
/);
__PACKAGE__->mk_group_accessors(component_class => qw/
result_class
/);
-__PACKAGE__->mk_classdata( sqlt_deploy_callback => 'default_sqlt_deploy_hook' );
-
=head1 NAME
DBIx::Class::ResultSource - Result source object
$new->{_relationships} = { %{$new->{_relationships}||{}} };
$new->{name} ||= "!!NAME NOT SET!!";
$new->{_columns_info_loaded} ||= 0;
+ $new->{sqlt_deploy_callback} ||= 'default_sqlt_deploy_hook';
return $new;
}
return $self;
}
-sub add_column { shift->add_columns(@_); } # DO NOT CHANGE THIS TO GLOB
+sub add_column {
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
+ shift->add_columns(@_)
+}
=head2 has_column
if ( ! $self->_columns->{$column}{data_type}
and ! $self->{_columns_info_loaded}
and $self->column_info_from_storage
- and my $stor = dbic_internal_try { $self->storage } )
+ and my $stor = dbic_internal_try { $self->schema->storage } )
{
$self->{_columns_info_loaded}++;
and
grep { ! $_->{data_type} } values %$colinfo
and
- my $stor = dbic_internal_try { $self->storage }
+ my $stor = dbic_internal_try { $self->schema->storage }
) {
$self->{_columns_info_loaded}++;
$self->_ordered_columns([ grep { not $to_remove{$_} } @{$self->_ordered_columns} ]);
}
-sub remove_column { shift->remove_columns(@_); } # DO NOT CHANGE THIS TO GLOB
+sub remove_column {
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
+ shift->remove_columns(@_)
+}
=head2 set_primary_key
=cut
sub add_unique_constraints {
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
+
my $self = shift;
my @constraints = @_;
=back
- __PACKAGE__->sqlt_deploy_callback('mycallbackmethod');
+ __PACKAGE__->result_source_instance->sqlt_deploy_callback('mycallbackmethod');
or
- __PACKAGE__->sqlt_deploy_callback(sub {
+ __PACKAGE__->result_source_instance->sqlt_deploy_callback(sub {
my ($source_instance, $sqlt_table) = @_;
...
} );
=cut
-sub storage { shift->schema->storage; }
+sub storage {
+ DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call;
+ $_[0]->schema->storage
+}
=head2 add_relationship
=cut
sub relationships {
- return keys %{shift->_relationships};
+ keys %{$_[0]->_relationships};
}
=head2 relationship_info
$args->{columns_info} ||= $self->columns_info;
- my $vals = $self->storage->_extract_fixed_condition_columns(
+ my $vals = $self->schema->storage->_extract_fixed_condition_columns(
$args->{values},
($args->{carp_on_nulls} ? 'consider_nulls' : undef ),
);
$force_left ||= lc($rel_info->{attrs}{join_type}||'') eq 'left';
# the actual seen value will be incremented by the recursion
- my $as = $self->storage->relname_to_table_alias(
+ my $as = $self->schema->storage->relname_to_table_alias(
$rel, ($seen->{$rel} && $seen->{$rel} + 1)
);
}
else {
my $count = ++$seen->{$join};
- my $as = $self->storage->relname_to_table_alias(
+ my $as = $self->schema->storage->relname_to_table_alias(
$join, ($count > 1 && $count)
);