1 package DBIx::Class::ResultSourceProxy::Table;
6 use base qw/DBIx::Class::ResultSourceProxy/;
7 __PACKAGE__->load_components(qw/AccessorGroup/);
9 __PACKAGE__->mk_group_accessors('component_class' => 'table_class');
10 __PACKAGE__->table_class('DBIx::Class::ResultSource::Table');
12 __PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do
17 DBIx::Class::ResultSourceProxy::Table - provides a classdata table
18 object and method proxies
22 __PACKAGE__->table('cd');
23 __PACKAGE__->add_columns(qw/cdid artist title year/);
24 __PACKAGE__->set_primary_key('cdid');
30 __PACKAGE__->add_columns(qw/cdid artist title year/);
32 Adds columns to the current class and creates accessors for them.
38 __PACKAGE__->table('tbl_name');
40 Gets or sets the table name.
45 my ($class, $table) = @_;
46 return $class->result_source_instance->name unless $table;
48 $table = $class->table_class->new({
49 $class->can('result_source_instance') ?
50 %{$class->result_source_instance} : (),
52 result_class => $class,
55 $class->mk_classdata('result_source_instance' => $table);
56 if ($class->can('schema_instance')) {
57 $class =~ m/([^:]+)$/;
58 $class->schema_instance->register_class($class, $class);
64 if ($obj->has_column($col)) { ... }
66 Returns 1 if the class has a column of this name, 0 otherwise.
72 my $info = $obj->column_info($col);
74 Returns the column metadata hashref for a column. For a description of
75 the various types of column data in this hashref, see
76 L<DBIx::Class::ResultSource/add_column>
82 my @column_names = $obj->columns;
90 Matt S. Trout <mst@shadowcatsystems.co.uk>
94 You may distribute this code under the same terms as Perl itself.