From ec4672d77037b3ca5c7752c9361ae09e2e8afa86 Mon Sep 17 00:00:00 2001
From: Yves Christian Kpakpo <yveschristian.kpakpo@maarch.org>
Date: Tue, 5 Feb 2013 21:31:20 +0000
Subject: [PATCH] Update: Add unset method to base object

---
 core/trunk/core/class/BaseObject.php | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/core/trunk/core/class/BaseObject.php b/core/trunk/core/class/BaseObject.php
index 4b1d34d0b33..53eb38a1150 100644
--- a/core/trunk/core/class/BaseObject.php
+++ b/core/trunk/core/class/BaseObject.php
@@ -99,11 +99,19 @@ class BaseObject {
 			return $this->data;
 	}
 	
+    /**
+    * Sets an array in the current object
+    */
 	public function setArray($array) 
 	{
 		$this->data = $array;
 	}
-	
+    
+	/**
+    * Get label of a given property 
+    *
+    * @return String label
+    */
 	public function getLabel($name){
 		if(in_array($name, array_keys($data))){
 			return eval("_".strtoupper($name));
@@ -111,6 +119,15 @@ class BaseObject {
 			return "";
 		}
 	}
-
+    
+    /**
+	* Delete a given property in the current object
+	* 
+	* @param string $name Name of property to delete
+	*/
+    public function __unset($name)
+	{
+        unset($this->data[$name]);
+    }
 }
 ?>
-- 
GitLab