1 package DBIx::Class::Schema::Loader::Column;
5 use base 'Class::Accessor::Grouped';
7 use Carp::Clan qw/^DBIx::Class/;
8 use Scalar::Util 'weaken';
13 DBIx::Class::Schema::Loader::Column - Class for Columns in
14 L<DBIx::Class::Schema::Loader>
18 Used for representing columns in
19 L<DBIx::Class::Schema::Loader::Base/col_accessor_map>.
21 Stringifies to L</name>, and arrayrefifies to the
22 L<name_parts|DBIx::Class::Schema::Loader::Table/name_parts> of
23 L</table> plus L</name>.
27 __PACKAGE__->mk_group_accessors(simple => qw/
33 '""' => sub { $_[0]->name },
34 '@{}' => sub { [ @{$_[0]->table->name_parts}, $_[0]->name ] },
41 The constructor. Takes L</table> and L</name> key-value parameters.
49 croak "table is required" unless ref $self->{table};
51 weaken $self->{table};
53 return bless $self, $class;
58 The L</DBIx::Class::Schema::Loader::Table> object this column belongs to.
59 Required parameter for L</new>
63 The name of the column. Required parameter for L</new>.