=cut
-sub _ident_cond {
- my ($class) = @_;
- return join(" AND ", map { "$_ = ?" } $class->primary_columns);
-}
-
sub _ident_values {
my ($self) = @_;
return (map { $self->{_column_data}{$_} } $self->primary_columns);
Re-selects the row from the database, losing any changes that had
been made.
+This method can also be used to refresh from storage, retrieving any
+changes made since the row was last read from storage.
+
=cut
sub discard_changes {
sub ident_condition {
my ($self, $alias) = @_;
my %cond;
- $cond{(defined $alias ? "${alias}.$_" : $_)} = $self->get_column($_)
- for $self->primary_columns;
+ my $prefix = defined $alias ? $alias.'.' : '';
+ $cond{$prefix.$_} = $self->get_column($_) for $self->primary_columns;
return \%cond;
}