[siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.10,1.11

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

From: muttley
Subject: [siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.10,1.11
Date: 13:04 on 08 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage
In directory usw-pr-cvs1:/tmp/cvs-serv4721/lib/Siesta/Storage

Modified Files:
	DBI.pm 
Log Message:
More checks.


Index: DBI.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- DBI.pm	8 Sep 2002 11:00:24 -0000	1.10
+++ DBI.pm	8 Sep 2002 12:03:59 -0000	1.11
@@ -290,7 +290,7 @@
 
 
 	# if we haven't been passed a value then fetch and return it
-	return $self->_get_config($namespace, $user_id, $list_id, $key) 
+	return $self->get_config($namespace, $user_id, $list_id, $key) 
 				if (!defined $value);	
 
 
@@ -301,7 +301,7 @@
 	# explicitly for this particular tuple and update or insert
 	# appropriately.
 
-	my $return = $self->_get_config_explicitly($namespace, $user_id, $list_id, $key);
+	my $return = $self->get_config_explicitly($namespace, $user_id, $list_id, $key);
 
 	my $sql;
 	# are we updating 
@@ -347,29 +347,29 @@
 #                 |
 #           system default
 #
-sub _get_config
+sub get_config
 {
 	my ($self, $namespace, $user_id, $list_id, $key) = @_;
 
 	unless (($user_id eq '')  || ($list_id eq ''))
 	{
-		my $return = $self->_get_config_explicitly($namespace, $user_id, $list_id, $key);
+		my $return = $self->get_config_explicitly($namespace, $user_id, $list_id, $key);
 		return $return if defined $return;
 	}	
 
 	unless ($user_id eq '')
 	{
-		my $return = $self->_get_config_explicitly($namespace, '', $list_id, $key);
+		my $return = $self->get_config_explicitly($namespace, '', $list_id, $key);
 		return $return if defined $return;
 	}	
 
 	unless ($list_id eq '')
 	{
-		my $return = $self->_get_config_explicitly($namespace, $user_id, '', $key);
+		my $return = $self->get_config_explicitly($namespace, $user_id, '', $key);
 		return $return if defined $return;
 	}	
 
-	return $self->_get_config_explicitly($namespace, '', '', $key);
+	return $self->get_config_explicitly($namespace, '', '', $key);
 
 	
 }
@@ -377,10 +377,13 @@
 
 # explicitly look up a config value for a given
 # namespace, user, list, key tuple. 
-sub _get_config_explicitly
+sub get_config_explicitly
 {
 	my ($self, $namespace, $user_id, $list_id, $key) = @_;
 
+	# just to be sure
+	$user_id ||= '';
+	$list_id ||= '';
 	
 	my @results = $self->_get_rows(table  => 'config',
 				 	where  => { user_id   => $user_id,



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