[siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.31,1.32

[prev] [thread] [next] [lurker] [Date index for 2002/09/20]

From: muttley
Subject: [siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.31,1.32
Date: 14:29 on 20 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage
In directory usw-pr-cvs1:/tmp/cvs-serv4423/lib/Siesta/Storage

Modified Files:
	DBI.pm 
Log Message:
Subscribe now challenges the user with a unique number.


Index: DBI.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- DBI.pm	17 Sep 2002 11:31:55 -0000	1.31
+++ DBI.pm	20 Sep 2002 13:29:39 -0000	1.32
@@ -80,6 +80,23 @@
       or die $dbh->errstr;
 }
 
+sub _delete
+{
+    my $self    = shift;
+    my %args    = @_;
+    my %where   = %{ $args{where} || {} };
+    my $dbh     = $self->_dbh();
+
+    my $sql     = "DELETE FROM $args{'table'}";
+    $sql       .= " WHERE "
+               . join ( ' AND ',
+                 map { "$_ = " . $dbh->quote( $where{$_} ) } keys %where )
+                 if %where;
+
+    $dbh->do($sql)
+      or die $dbh->errstr;
+}
+
 sub get_lists {
     my $self = shift;
 
@@ -369,6 +386,31 @@
 
     return $results[0]->{value};
 }
+
+sub delete_config {
+    my ( $self, $namespace, $user_id, $list_id, $key) = @_;
+
+    # just to be sure
+    $user_id ||= '';
+    $list_id ||= '';
+    my $where = {
+                  user_id   => $user_id,
+                  list_id   => $list_id,
+                  key       => $key,
+                  namespace => $namespace
+                  };
+    
+    my %args = (
+                table   => 'config',
+                where   => $where,
+	       );
+
+
+    my @results = $self->_delete(%args);
+
+}
+
+
 
 # add plugin into the processing queue for a list
 # providing a number will insert at that position.



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52