[Bps-public-commit] r9713 - in Net-Hiveminder: lib/Net

sartak at bestpractical.com sartak at bestpractical.com
Tue Nov 20 19:03:20 EST 2007


Author: sartak
Date: Tue Nov 20 19:03:20 2007
New Revision: 9713

Modified:
   Net-Hiveminder/   (props changed)
   Net-Hiveminder/lib/Net/Hiveminder.pm

Log:
 r45446 at onn:  sartak | 2007-11-20 19:01:12 -0500
 Finish off task CRUD


Modified: Net-Hiveminder/lib/Net/Hiveminder.pm
==============================================================================
--- Net-Hiveminder/lib/Net/Hiveminder.pm	(original)
+++ Net-Hiveminder/lib/Net/Hiveminder.pm	Tue Nov 20 19:03:20 2007
@@ -140,24 +140,52 @@
 =cut
 
 sub create_task {
-    my $self = shift;
+    my $self    = shift;
     my $summary = shift;
 
-    $self->create('Task', summary => $summary);
+    $self->create(Task => summary => $summary);
 }
 
-=head2 load_task Key => Value
+=head2 read_task Locator
 
-Load a task with the given Key => Value.
+Load a task with the given record locator.
 
 =cut
 
-sub load_task {
+sub read_task {
     my $self  = shift;
-    my $key   = shift;
-    my $value = shift;
+    my $loc   = shift;
+    my $id    = $LOCATOR->decode($loc);
+
+    return $self->read(Task => id => $id);
+}
+
+=head2 update_task Locator, Args
+
+Takes a record locator and uses it to update that task with Args.
+
+=cut
+
+sub update_task {
+    my $self = shift;
+    my $loc  = shift;
+    my $id   = $LOCATOR->decode($loc);
+
+    return $self->update(Task => id => $id, @_);
+}
+
+=head2 delete_task Locator
+
+Takes a record locator and uses it to delete that task.
+
+=cut
+
+sub delete_task {
+    my $self = shift;
+    my $loc  = shift;
+    my $id   = $LOCATOR->decode($loc);
 
-    return $self->read('Task', $key => $value);
+    return $self->delete(Task => id => $id);
 }
 
 =head2 load_date Date



More information about the Bps-public-commit mailing list