NAME
Class::DBI::ColumnGrouper - Columns and Column Groups
SYNOPSIS
my $colg = Class::DBI::ColumnGrouper->new;
$colg->add_group(People => qw/star director producer/);
my @cols = $colg->group_cols($group);
my @groups = $colg->groups_for($column);
my @all = $colg->all_columns;
my $pri_col = $colg->primary;
if ($colg->exists($column_name)) { ... }
if ($colg->in_database($column_name)) { ... }
DESCRIPTION
Each Class::DBI class maintains a list of its columns as class data. This provides an interface to that. You probably don't want to be dealing with this directly.
METHODS
new
my $colg = Class::DBI::ColumnGrouper->new;
A new blank ColumnnGrouper object.
add_group
$colg->add_group(People => qw/star director producer/);
This adds a list of columns as a column group.
group_cols
my @colg = $cols->group_cols($group);
This returns a list of all columns which are in the given group.
groups_for
my @groups = $colg->groups_for($column);
This returns a list of all groups of which the given column is a member.
all_columns
my @all = $colg->all_columns;
This returns a list of all columns.
primary
my $pri_col = $colg->primary;
This returns the name of the primary key column.
essential
my @essential_cols = $colg->essential;
This returns a list of the columns in the Essential group.
exists / in_database
if ($colg->exists($column_name)) { ... } if
($colg->in_database($column_name)) { ... }
These tell us if the column exists at all, and if it's actually in the database (and not a TEMP column).