sub storage { shift->storage_instance(@_); }
+sub resultset_instance {
+ my $class = shift;
+ my $table = $class->table_instance->new($class->table_instance);
+ $table->storage($class->storage_instance);
+ $table->result_class($class);
+ return $table->resultset;
+}
+
=head1 NAME
DBIx::Class::DB - Simple DBIx::Class Database connection by class inheritance
__PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do anything yet!
__PACKAGE__->mk_classdata('_resultset_class' => 'DBIx::Class::ResultSet');
+__PACKAGE__->mk_classdata('table_class' => 'DBIx::Class::Table');
sub iterator_class { shift->table_instance->resultset_class(@_) }
sub resultset_class { shift->table_instance->resultset_class(@_) }
$class->_mk_column_accessors(@cols);
}
-sub resultset_instance {
- my $class = shift;
- my $table = $class->table_instance->new($class->table_instance);
- $table->storage($class->storage_instance);
- $table->result_class($class);
- return $table->resultset;
-}
-
sub _select_columns {
return shift->table_instance->columns;
}
my ($class, $table) = @_;
return $class->table_instance->name unless $table;
unless (ref $table) {
- $table = DBIx::Class::Table->new(
+ $table = $class->table_class->new(
{
name => $table,
result_class => $class,