=head1 METHODS
-=over 4
-
=cut
sub _register_columns {
$class->mk_group_accessors('column' => @cols);
}
-=item add_columns
+=head2 add_columns
__PACKAGE__->add_columns(qw/col1 col2 col3/);
$class->_mk_column_accessors(@cols);
}
-=item search_literal
+=head2 search_literal
my @obj = $class->search_literal($literal_where_cond, @bind);
my $cursor = $class->search_literal($literal_where_cond, @bind);
return $class->search(\$cond, $attrs);
}
-=item count_literal
+=head2 count_literal
my $count = $class->count_literal($literal_where_cond);
return $class->search_literal(@_)->count;
}
-=item count
+=head2 count
my $count = $class->count({ foo => 3 });
return $class->search(@_)->count;
}
-=item search
+=head2 search
my @obj = $class->search({ foo => 3 }); # "... WHERE foo = 3"
my $cursor = $class->search({ foo => 3 });
my $rs = $rs_class->new($class, @_);
}
-=item search_like
+=head2 search_like
Identical to search except defaults to 'LIKE' instead of '=' in condition
return keys %{$_[0]->_columns};
}
-=item table
+=head2 table
__PACKAGE__->table('tbl_name');
shift->_table_name(@_);
}
-=item find_or_create
+=head2 find_or_create
$class->find_or_create({ key => $val, ... });
return defined($exists) ? $exists : $class->create($hash);
}
-=item has_column
+=head2 has_column
if ($obj->has_column($col)) { ... }
return exists $self->_columns->{$column};
}
-=item column_info
+=head2 column_info
my $info = $obj->column_info($col);
return $self->_columns->{$column};
}
-=item columns
+=head2 columns
my @column_names = $obj->columns;
1;
-=back
-
=head1 AUTHORS
Matt S. Trout <mst@shadowcatsystems.co.uk>