use warnings;
use base qw/DBIx::Class/;
- use DBIx::Class::ResultSource::View;
-
__PACKAGE__->load_components('Core');
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
# Create a query (view) based result source, in a result class
package MyDB::Schema::Result::Year2000CDs;
- use DBIx::Class::ResultSource::View;
-
__PACKAGE__->load_components('Core');
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
package MyDB::Schema::Result::Year2000CDs;
use base qw/DBIx::Class/;
- use DBIx::Class::ResultSource::View;
__PACKAGE__->load_components('Core');
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
use base qw/DBIx::Class::ResultSourceProxy/;
-use DBIx::Class::ResultSource::Table;
-
__PACKAGE__->mk_classdata(table_class => 'DBIx::Class::ResultSource::Table');
__PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do
my $class_has_table_instance = ($table and $table->result_class eq $class);
return $table if $class_has_table_instance;
+ my $table_class = $class->table_class;
+ $class->ensure_class_loaded($table_class);
+
if( $table ) {
- $table = $class->table_class->new({
+ $table = $table_class->new({
%$table,
result_class => $class,
source_name => undef,
});
}
else {
- $table = $class->table_class->new({
+ $table = $table_class->new({
name => undef,
result_class => $class,
source_name => undef,
my ($class, $table) = @_;
return $class->result_source_instance->name unless $table;
unless (ref $table) {
- $table = $class->table_class->new({
+
+ my $table_class = $class->table_class;
+ $class->ensure_class_loaded($table_class);
+
+ $table = $table_class->new({
$class->can('result_source_instance') ?
%{$class->result_source_instance||{}} : (),
name => $table,