Ejemplo n.º 1
0
 /**
  * unset/remove data key from data array if first argument key is not null. will reset the whole data array if first
  * argument is null. the key can be passed in "." notation to unset data in multidimensional array
  *
  * @error 14311
  * @param null|int|string $key expects the key to delete data value for
  */
 public function unsetData($key = null)
 {
     if ($key !== null) {
         if ($this->hasData($key)) {
             xapp_array_unset($this->_data, $key);
         }
     } else {
         $this->_data = array();
     }
 }
Ejemplo n.º 2
0
 /**
  * overload class property with unset function will work only if parameter exists in data array if not
  * will throw exception
  *
  * @error 14515
  * @param string $name expects data parameter key
  * @throws Xapp_Rpc_Response_Exception
  */
 public function __unset($name)
 {
     if ($this->has($name)) {
         xapp_array_unset($this->_data, $name);
     } else {
         throw new Xapp_Rpc_Response_Exception(_("overloading and unsetting property only allowed for data parameters"), 1451501);
     }
 }