]> git.mxchange.org Git - core.git/commitdiff
Added magic methods __get/set(). Please watch these messages carefully
authorRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2011 15:52:55 +0000 (15:52 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2011 15:52:55 +0000 (15:52 +0000)
inc/classes/main/class_BaseFrameworkSystem.php

index c890cc23c0529f3c0109a00ed19e3c19f68da5f4..7d5ac4a8578bd043d1b3ccc55c79b264b1657b8d 100644 (file)
@@ -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
         *