DBIx-SQLEngine
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
SQLEngine/Record/Cache.pm view on Meta::CPAN
Attempts to update the record using its primary key as a unique identifier.
Calls SUPER method, so implemented using MIXIN.
Clears the cache.
=back
=cut
# $record->update_record()
sub update_record {
my $self = shift;
$self->cache_clear();
$self->NEXT('update_record', @_ );
}
########################################################################
=head2 Delete to Remove Records
=over 4
SQLEngine/Record/Hooks.pm view on Meta::CPAN
Inheritable Hook. Add functions which should be called immediately after a row is updated.
=back
=cut
use Class::MakeMethods::Composite::Inheritable(hook=>'ok_update pre_update post_update');
# $record->update_record()
sub update_record {
my $self = shift;
my $class = ref( $self ) or croak("Not a class method");
my @flags = $self->ok_update;
if ( grep { length $_ and ! $_ } @flags ) {
# warn "Cancelling update of $self: " . join(', ', map "'$_'", @flags );
return undef;
}
# warn "About to update $self: " . join(', ', map "'$_'", @flags );
$self->pre_update();
$self->NEXT('update_record');
SQLEngine/Record/Table.pm view on Meta::CPAN
$record_obj->update_record() : $record_count
Attempts to update the record using its primary key as a unique identifier. Returns the number of rows affected, which should be 1 unless there's an error.
=back
=cut
# $record_obj->update_record();
sub update_record {
(shift)->table_record_method('update_row');
}
########################################################################
=head2 Delete to Remove Records
=over 4
=item delete_record()
SQLEngine/Schema/Table.pm view on Meta::CPAN
=back
=cut
# $self->do_update( %clauses);
sub do_update {
(shift)->sqlengine_do('do_update', @_ )
}
# $self->update_row( $row );
sub update_row {
my($self, $row) = @_;
$self->sqlengine_do('do_update',
columns => [ $self->column_names ],
where => $self->primary_criteria( $row ),
values => $row,
);
}
# $self->update_rows( @hashes );
sub update_rows {
my $self = shift;
my $rc;
foreach my $row ( @_ ) { $rc += $self->update_row( $row ) }
$rc
}
########################################################################
=head2 Delete to Remove Rows
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.536 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )