From: Roland Häder Date: Tue, 29 Mar 2011 15:52:55 +0000 (+0000) Subject: Added magic methods __get/set(). Please watch these messages carefully X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=a6ec0211ffb9b65e7c8efd81abdbb925774264ff Added magic methods __get/set(). Please watch these messages carefully --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index c890cc23..7d5ac4a8 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -310,6 +310,33 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->realClass; } + /** + * Magic function to catch setting of missing but set class fields/attributes + * + * @param $name Name of the field/attribute + * @param $value Value to store + * @return void + */ + public final function __set ($name, $value) { + $this->debugOutput(sprintf("Tried to set a missing field. name=%s, value[%s]=%s", + $name, + gettype($value), + $value + )); + } + + /** + * Magic function to catch getting of missing fields/attributes + * + * @param $name Name of the field/attribute + * @return void + */ + public final function __get ($name) { + $this->debugOutput(sprintf("Tried to get a missing field. name=%s", + $name + )); + } + /** * Setter for database result instance *