__PACKAGE__->mk_group_accessors('simple' => 'result_source');
-=head1 NAME
+=head1 NAME
DBIx::Class::Row - Basic row methods
unless ref($attrs) eq 'HASH';
while (my ($k, $v) = each %$attrs) {
$new->throw_exception("No such column $k on $class")
- unless $class->has_column($k);
+ unless $class->has_column($k);
$new->store_column($k => $v);
}
}
$obj->delete
-Deletes the object from the database. The object is still perfectly usable,
-but ->in_storage() will now return 0 and the object must re inserted using
+Deletes the object from the database. The object is still perfectly usable,
+but ->in_storage() will now return 0 and the object must re inserted using
->insert() before ->update() can be used on it.
=cut
$self->throw_exception("Cannot safely delete a row in a PK-less table")
if ! keys %$ident_cond;
foreach my $column (keys %$ident_cond) {
- $self->throw_exception("Can't delete the object unless it has loaded the primary keys")
- unless exists $self->{_column_data}{$column};
+ $self->throw_exception("Can't delete the object unless it has loaded the primary keys")
+ unless exists $self->{_column_data}{$column};
}
$self->result_source->storage->delete(
$self->result_source->from, $ident_cond);
sub store_column {
my ($self, $column, $value) = @_;
- $self->throw_exception( "No such column '${column}'" )
+ $self->throw_exception( "No such column '${column}'" )
unless exists $self->{_column_data}{$column} || $self->has_column($column);
- $self->throw_exception( "set_column called for ${column} without value" )
+ $self->throw_exception( "set_column called for ${column} without value" )
if @_ < 3;
return $self->{_column_data}{$column} = $value;
}
if (ref($pre_val->[0]) eq 'ARRAY') { # multi
my @pre_objects;
foreach my $pre_rec (@$pre_val) {
- unless ($pre_source->primary_columns == grep { exists $pre_rec->[0]{$_}
+ unless ($pre_source->primary_columns == grep { exists $pre_rec->[0]{$_}
and defined $pre_rec->[0]{$_} } $pre_source->primary_columns) {
next;
}
$new->related_resultset($pre)->set_cache(\@pre_objects);
} elsif (defined $pre_val->[0]) {
my $fetched;
- unless ($pre_source->primary_columns == grep { exists $pre_val->[0]{$_}
+ unless ($pre_source->primary_columns == grep { exists $pre_val->[0]{$_}
and !defined $pre_val->[0]{$_} } $pre_source->primary_columns)
{
$fetched = $pre_source->result_class->inflate_result(
- $pre_source, @{$pre_val});
+ $pre_source, @{$pre_val});
}
my $accessor = $source->relationship_info($pre)->{attrs}{accessor};
$class->throw_exception("No accessor for prefetched $pre")