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,
56 $class->mk_classdata('result_source_instance' => $table);
57 if ($class->can('schema_instance')) {
58 $class =~ m/([^:]+)$/;
59 $class->schema_instance->register_class($class, $class);
65 if ($obj->has_column($col)) { ... }
67 Returns 1 if the class has a column of this name, 0 otherwise.
73 my $info = $obj->column_info($col);
75 Returns the column metadata hashref for a column. For a description of
76 the various types of column data in this hashref, see
77 L<DBIx::Class::ResultSource/add_column>
83 my @column_names = $obj->columns;
91 Matt S. Trout <mst@shadowcatsystems.co.uk>
95 You may distribute this code under the same terms as Perl itself.