__PACKAGE__->mk_group_accessors('component_class' => qw/resultset_class
result_class/);
-=head1 NAME
+=head1 NAME
DBIx::Class::ResultSource - Result source object
=over 4
-=item accessor
+=item accessor
Use this to set the name of the accessor for this column. If unset,
the name of the column will be used.
=item size
The length of your column, if it is a column type that can have a size
-restriction. This is currently not used by DBIx::Class.
+restriction. This is currently not used by DBIx::Class.
=item is_nullable
Set this to the default value which will be inserted into a column
by the database. Can contain either a value or a function. This is
-currently not used by DBIx::Class.
+currently not used by DBIx::Class.
=item sequence
sub column_info {
my ($self, $column) = @_;
- $self->throw_exception("No such column $column")
+ $self->throw_exception("No such column $column")
unless exists $self->_columns->{$column};
#warn $self->{_columns_info_loaded}, "\n";
- if ( ! $self->_columns->{$column}{data_type}
- and ! $self->{_columns_info_loaded}
+ if ( ! $self->_columns->{$column}{data_type}
+ and ! $self->{_columns_info_loaded}
and $self->schema and $self->storage )
{
$self->{_columns_info_loaded}++;
my $info;
- # eval for the case of storage without table
+ # eval for the case of storage without table
eval { $info = $self->storage->columns_info_for($self->from) };
unless ($@) {
foreach my $col ( keys %{$self->_columns} ) {
Additionally, defines a unique constraint named C<primary>.
The primary key columns are used by L<DBIx::Class::PK::Auto> to
-retrieve automatically created values from the database.
+retrieve automatically created values from the database.
=cut
=head2 storage
-Returns the storage handle for the current schema.
+Returns the storage handle for the current schema.
See also: L<DBIx::Class::Storage>
=item accessor
Specifies the type of accessor that should be created for the
-relationship. Valid values are C<single> (for when there is only a single
-related object), C<multi> (when there can be many), and C<filter> (for
-when there is a single related object, but you also want the relationship
-accessor to double as a column accessor). For C<multi> accessors, an
-add_to_* method is also created, which calls C<create_related> for the
+relationship. Valid values are C<single> (for when there is only a single
+related object), C<multi> (when there can be many), and C<filter> (for
+when there is a single related object, but you also want the relationship
+accessor to double as a column accessor). For C<multi> accessors, an
+add_to_* method is also created, which calls C<create_related> for the
relationship.
=back
eval { $self->resolve_join($rel, 'me') };
if ($@) { # If the resolve failed, back out and re-throw the error
- delete $rels{$rel}; #
+ delete $rels{$rel}; #
$self->_relationships(\%rels);
$self->throw_exception("Error creating relationship $rel: $@");
}
sub relationship_info {
my ($self, $rel) = @_;
return $self->_relationships->{$rel};
-}
+}
=head2 has_relationship
while (my ($k, $v) = each %{$cond}) {
# XXX should probably check these are valid columns
$k =~ s/^foreign\.// ||
- $self->throw_exception("Invalid rel cond key ${k}");
+ $self->throw_exception("Invalid rel cond key ${k}");
$v =~ s/^self\.// ||
- $self->throw_exception("Invalid rel cond val ${v}");
+ $self->throw_exception("Invalid rel cond val ${v}");
if (ref $for) { # Object
#warn "$self $k $for $v";
$ret{$k} = $for->get_column($v);
# 'artist.name',
# 'producer.producerid',
# 'producer.name'
- #)
+ #)
=cut
sub throw_exception {
my $self = shift;
- if (defined $self->schema) {
+ if (defined $self->schema) {
$self->schema->throw_exception(@_);
} else {
croak(@_);