/** * Magic unset function for parameter values */ public function __unset($name) { if (strncmp($name, 'param_', 6) == 0) { $paramname = substr($name, 6); $params = unserialize($this->params); unset($params[$paramname]); $this->params = serialize($params); } else { return parent::__unset($name); } }
/** * Magic set method to unset the value of a custom field. See __get. */ public function __unset($name) { $prefix_len = strlen(self::CUSTOM_FIELD_PREFIX); if (strncmp($name, self::CUSTOM_FIELD_PREFIX, $prefix_len) == 0) { $this->_load_fields(); $shortname = substr($name, $prefix_len); if (isset(self::$_fields[$this->get_field_context_level()][$shortname])) { unset($this->_field_data[$shortname]); } $this->_field_changed[$shortname] = true; return; } return parent::__unset($name); }