use Scalar::Util 'blessed';
use namespace::clean;
-__PACKAGE__->mk_classdata(table_class => 'DBIx::Class::ResultSource::Table');
+__PACKAGE__->mk_classaccessor(table_class => 'DBIx::Class::ResultSource::Table');
-__PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do
- # anything yet!
+# FIXME: Doesn't actually do anything yet!
+__PACKAGE__->mk_group_accessors( inherited => 'table_alias' );
sub _init_result_source_instance {
my $class = shift;
- $class->mk_classdata('result_source_instance')
- unless $class->can('result_source_instance');
+ $class->mk_group_accessors( inherited => 'result_source_instance' )
+ unless $class->can('result_source_instance');
my $table = $class->result_source_instance;
- my $class_has_table_instance = ($table and $table->result_class eq $class);
- return $table if $class_has_table_instance;
+ return $table
+ if $table and $table->result_class eq $class;
my $table_class = $class->table_class;
$class->ensure_class_loaded($table_class);
});
}
- $class->mk_classdata('result_source_instance')
+ $class->mk_group_accessors(inherited => 'result_source_instance')
unless $class->can('result_source_instance');
$class->result_source_instance($table);
Gets or sets the table class used for construction and validation.
-=cut
-
=head2 has_column
if ($obj->has_column($col)) { ... }
Returns 1 if the class has a column of this name, 0 otherwise.
-=cut
-
=head2 column_info
my $info = $obj->column_info($col);
the various types of column data in this hashref, see
L<DBIx::Class::ResultSource/add_column>
-=cut
-
=head2 columns
my @column_names = $obj->columns;
-=cut
+=head1 FURTHER QUESTIONS?
-1;
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
-=head1 AUTHOR AND CONTRIBUTORS
+=head1 COPYRIGHT AND LICENSE
-See L<AUTHOR|DBIx::Class/AUTHOR> and L<CONTRIBUTORS|DBIx::Class/CONTRIBUTORS> in DBIx::Class
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
-=head1 LICENSE
+=cut
-You may distribute this code under the same terms as Perl itself.
+1;
-=cut