summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2006-02-03 05:05:18 +0000
committerJason Woodward2006-02-03 05:05:18 +0000
commit626a1a4ac493845c6581f65389e1051d0f543e4d (patch)
treefa29a1d518174eaf85372c6438da76763179bb01
parentf4d221c64fddd4ae8d855e8cb33d00c7cb62b502 (diff)
downloadJaos-DBI-626a1a4ac493845c6581f65389e1051d0f543e4d.tar.gz
doc updates
-rw-r--r--README6
-rw-r--r--lib/Jaos/DBI.pm4
2 files changed, 5 insertions, 5 deletions
diff --git a/README b/README
index b69aa36..71623ed 100644
--- a/README
+++ b/README
@@ -53,7 +53,8 @@ SYNOPSIS
# modify
$user->email('newaddress@foo.com'); # setting attribute updates the database
$user->delete();
- $user->update() unless $user->manual_update == 1;
+ $user->update() unless $user->manual_update;
+ $user->update() if $user->is_changed;
User->delete(nick => 'zaphod', email => 'newaddress@foo.com');
DESCRIPTION
@@ -126,6 +127,9 @@ METHODS
Get or set the option to stop auto update on modification. Must call
__PACKAGE__->update() manually.
+ is_changed
+ Returns true if object has been modified.
+
sequence
Get or set the tables sequence. This is used to generate unique primary
keys.
diff --git a/lib/Jaos/DBI.pm b/lib/Jaos/DBI.pm
index 4f6b007..49fa59e 100644
--- a/lib/Jaos/DBI.pm
+++ b/lib/Jaos/DBI.pm
@@ -407,7 +407,6 @@ sub insert
$sql .= join(',',@columns) . ') values (';
$sql .= join(',',('?') x scalar(keys %opts)) . ')';
- #print STDERR "insert:$sql [",join(',',map {$opts{$_} ? $opts{$_} : undef} @columns),"]\n";
eval {
my $stmt = $self->prepare($sql) or die "Faild to prepare [$sql]";
$stmt->execute(map {$opts{$_} ? $opts{$_} : undef} @columns) or $stmt->finish(),die "[$sql]" . $!;
@@ -583,7 +582,6 @@ sub _do_search
}
my $result = [];
- #print STDERR "search:",$sql,"[",join(',',@values),"]","\n";
eval {
my $stmt = $self->prepare($sql) or die "Failed to prepare [$sql]";
$stmt->execute(@values) or $stmt->finish(),die "[$sql]" . $!;
@@ -641,7 +639,6 @@ sub delete
return;
}
- #print STDERR "delete:$sql [",join(',',@values),"]\n";
eval {
my $stmt = $self->prepare($sql) or die "Failed to prepare [$sql]";
$stmt->execute(@values) or $stmt->finish(),die "[$sql]" . $!;
@@ -722,7 +719,6 @@ sub _update
}
my $stmt;
- #print STDERR "update:$sql ",join(',',@values),"\n";
eval {
my $stmt = $self->prepare($sql) or die "Failed to prepare [$sql]";
$stmt->execute(@values) or $stmt->finish(),die "[$sql]" . $!;