X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSourceProxy%2FTable.pm;h=b2921e631adfb1c299aa57ebbbd4a7ea7da11deb;hb=c5cf11f1e582b7380a6a91b29cf3ba0b26fcaea0;hp=0d76f3f0113cae0224d834ac90cdc0210c45a0ef;hpb=988bf309a079c45bf5323d806453a9b430138a96;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSourceProxy/Table.pm b/lib/DBIx/Class/ResultSourceProxy/Table.pm index 0d76f3f..b2921e6 100644 --- a/lib/DBIx/Class/ResultSourceProxy/Table.pm +++ b/lib/DBIx/Class/ResultSourceProxy/Table.pm @@ -9,23 +9,25 @@ __PACKAGE__->load_components(qw/AccessorGroup/); __PACKAGE__->mk_group_accessors('component_class' => 'table_class'); __PACKAGE__->table_class('DBIx::Class::ResultSource::Table'); -__PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do anything yet! +__PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do + # anything yet! -=head1 NAME +=head1 NAME -DBIx::Class::ResultSourceProxy::Table - provides a classdata table object and method proxies +DBIx::Class::ResultSourceProxy::Table - provides a classdata table +object and method proxies =head1 SYNOPSIS - __PACKAGE__->table('foo'); - __PACKAGE__->add_columns(qw/id bar baz/); - __PACKAGE__->set_primary_key('id'); + __PACKAGE__->table('cd'); + __PACKAGE__->add_columns(qw/cdid artist title year/); + __PACKAGE__->set_primary_key('cdid'); =head1 METHODS =head2 add_columns - __PACKAGE__->add_columns(qw/col1 col2 col3/); + __PACKAGE__->add_columns(qw/cdid artist title year/); Adds columns to the current class and creates accessors for them. @@ -44,7 +46,8 @@ sub table { return $class->result_source_instance->name unless $table; unless (ref $table) { $table = $class->table_class->new({ - $class->can('result_source_instance') ? %{$class->result_source_instance} : (), + $class->can('result_source_instance') ? + %{$class->result_source_instance} : (), name => $table, result_class => $class, }); @@ -70,7 +73,7 @@ Returns 1 if the class has a column of this name, 0 otherwise. Returns the column metadata hashref for a column. For a description of the various types of column data in this hashref, see -L +L =cut