I hate you all.
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSourceProxy / Table.pm
index 6717f82..f70f2bc 100644 (file)
@@ -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,9 +46,11 @@ 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,
+        source_name => undef,
     });
   }
   $class->mk_classdata('result_source_instance' => $table);
@@ -56,27 +60,29 @@ sub table {
   }
 }
 
-=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);                                           
-                                                                                
-Returns the column metadata hashref for a column.
-                                                                                
-=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);
+
+Returns the column metadata hashref for a column. For a description of
+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                                                                            
+  my @column_names = $obj->columns;
+
+=cut
 
 1;