Skip to content
Snippets Groups Projects
Commit ec4672d7 authored by Yves Christian KPAKPO's avatar Yves Christian KPAKPO
Browse files

Update: Add unset method to base object

parent 0ec49b0f
No related branches found
No related tags found
No related merge requests found
......@@ -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]);
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment