1 package DBIx::Class::ResultSourceProxy::Table;
6 use base qw/DBIx::Class::ResultSourceProxy/;
8 use DBIx::Class::ResultSource::Table;
10 __PACKAGE__->mk_classdata(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,
57 $class->mk_classdata('result_source_instance')
58 unless $class->can('result_source_instance');
60 $class->result_source_instance($table);
62 if ($class->can('schema_instance')) {
63 $class =~ m/([^:]+)$/;
64 $class->schema_instance->register_class($class, $class);
70 if ($obj->has_column($col)) { ... }
72 Returns 1 if the class has a column of this name, 0 otherwise.
78 my $info = $obj->column_info($col);
80 Returns the column metadata hashref for a column. For a description of
81 the various types of column data in this hashref, see
82 L<DBIx::Class::ResultSource/add_column>
88 my @column_names = $obj->columns;
96 Matt S. Trout <mst@shadowcatsystems.co.uk>
100 You may distribute this code under the same terms as Perl itself.