oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ah...@apache.org
Subject svn commit: r1145358 - /oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php
Date Mon, 11 Jul 2011 21:15:59 GMT
Author: ahart
Date: Mon Jul 11 21:15:59 2011
New Revision: 1145358

URL: http://svn.apache.org/viewvc?rev=1145358&view=rev
Log:
restored ability to associate arbitrary key/value data with a response object

Modified:
    oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php

Modified: oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php
URL: http://svn.apache.org/viewvc/oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php?rev=1145358&r1=1145357&r2=1145358&view=diff
==============================================================================
--- oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php (original)
+++ oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php Mon Jul 11 21:15:59 2011
@@ -40,6 +40,8 @@ class Org_Apache_Oodt_Balance_Core_Appli
 	protected $stylesheets = array();
 	protected $javascripts = array();
 	
+	protected $data;
+
 	const DYN_JS_TAG  = '<!-- JAVASCRIPTS -->';
 	const DYN_CSS_TAG = '<!-- STYLESHEETS -->';
 	
@@ -246,6 +248,24 @@ class Org_Apache_Oodt_Balance_Core_Appli
 	public function getFooterContent() {
 		return $this->footer;
 	}
+
+	public function data($key = null, $value = null) {
+	       
+		// Return the data store associated with this request
+		if ($key == null && $value == null) {
+			return $this->data;
+		}
+					
+		// Return the stored value for the provided key
+		if ($value == null) {
+			return isset($this->data[$key]) 
+				? $this->data[$key] 
+				: null;
+		}
+															   
+		// Set the stored value for the key to the provided value
+		$this->data[$key] = $value;
+	}
 	
 	public function addStylesheet($href,$condition='') {
 		// Build the string for the css import



Mime
View raw message