/** * xapp option shortcut xapp_reset_option reset an option value making sure that in case when xapp option handling is * used arrays are fully resetet and not merged when setting options the xapp option functionality. the third parameter * can be: * 1) array = setting $key to $mixed * 2) object = object instance implementing xapp option handling or not * 3) string = object class name as string to handle static classes/options * 4) null = null when called inside class for xapp option handling for auto caller determination * * @param null|string $key expects the option key name * @param null|mixed $value expects the option key value * @param null|object|string $mixed expects value according to explanation above * @return void */ function xapp_reset_option($key = null, $value = null, &$mixed = null) { if (is_array($mixed)) { if (xapp_has_option($key, $mixed)) { $mixed[$key] = $value; } } else { if (xapped()) { Xapp::resetOption($key, $value, $mixed); } else { if (is_object($mixed) && xapp_can_options($mixed)) { if (xapp_has_option($key, $mixed)) { $mixed->options[$key] = $value; } } else { if (is_string($mixed) && xapp_can_options($mixed)) { if (xapp_has_option($key, $mixed)) { $mixed::$options[$key] = $value; } } } } } }