X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FTable.pm;h=cce20eff18068ad7739859689d89fce3777336bc;hb=8091aa9182ff763aa607dd82f4d61b99f8adab37;hp=fa8ecc002c840d8fb86d7a1a79cfa9bba3bf5b1f;hpb=bfab575afa37545ee175b824cea554c9c37ab6f5;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Table.pm b/lib/DBIx/Class/Table.pm index fa8ecc0..cce20ef 100644 --- a/lib/DBIx/Class/Table.pm +++ b/lib/DBIx/Class/Table.pm @@ -25,13 +25,11 @@ DBIx::Class::Table - Basic table methods =head1 DESCRIPTION -This class is responsible for defining and doing basic operations on -L objects. +This class is responsible for defining and doing table-level operations on +L classes. =head1 METHODS -=over 4 - =cut sub _register_columns { @@ -48,11 +46,11 @@ sub _mk_column_accessors { $class->mk_group_accessors('column' => @cols); } -=item add_columns +=head2 add_columns __PACKAGE__->add_columns(qw/col1 col2 col3/); -Adds columns to the current package, and creates accessors for them +Adds columns to the current class and creates accessors for them. =cut @@ -78,9 +76,11 @@ sub _select_columns { return keys %{$_[0]->_columns}; } -=item table +=head2 table __PACKAGE__->table('tbl_name'); + +Gets or sets the table name. =cut @@ -88,12 +88,12 @@ sub table { shift->_table_name(@_); } -=item find_or_create +=head2 find_or_create $class->find_or_create({ key => $val, ... }); Searches for a record matching the search condition; if it doesn't find one, -creates one and returns that instead +creates one and returns that instead. =cut @@ -104,11 +104,11 @@ sub find_or_create { return defined($exists) ? $exists : $class->create($hash); } -=item has_column +=head2 has_column if ($obj->has_column($col)) { ... } -Returns 1 if the object has a column of this name, 0 otherwise +Returns 1 if the class has a column of this name, 0 otherwise. =cut @@ -117,11 +117,11 @@ sub has_column { return exists $self->_columns->{$column}; } -=item column_info +=head2 column_info my $info = $obj->column_info($col); -Returns the column metadata hashref for the column +Returns the column metadata hashref for a column. =cut @@ -131,7 +131,7 @@ sub column_info { return $self->_columns->{$column}; } -=item columns +=head2 columns my @column_names = $obj->columns; @@ -144,8 +144,6 @@ sub columns { 1; -=back - =head1 AUTHORS Matt S. Trout