]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/extended/class_SerializationContainer.php
A lot more old methods deprecated and already deprecated methods removed
[shipsimu.git] / inc / classes / main / extended / class_SerializationContainer.php
index 136c07b8fdec6092ff0958bbf341945fc02fea31..2f967e4b360d8d9c44d5712f3c0afb3b8ba51e14 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.ship-simu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  */
 class SerializationContainer extends FrameworkArrayObject {
        /**
-        * Protected constructor, please use the factory method belo!
+        * Protected constructor, must stay as public... *sigh*
         *
         * @return      void
         */
-       protected function __construct () {
+       public function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -55,19 +55,8 @@ class SerializationContainer extends FrameworkArrayObject {
 
                        // Is the required method available?
                        if (method_exists($object, sprintf("get%s", $curr))) {
-                               // Generate a command for getting it
-                               $eval = sprintf("\$value = \$object->get%s();",
-                                       $curr
-                               );
-
-                               // Debug eval command
-                               if (defined('DEBUG_EVAL')) $limitInstance->getDebugInstance()->output(sprintf("[%s:] Constructed PHP command: <pre><em>%s</em></pre><br />\n",
-                                       $this->__toString(),
-                                       htmlentities($eval)
-                               ));
-
-                               // Run it
-                               eval($eval);
+                               // Generate call-back function
+                               $value = call_user_func_array(array($object, sprintf("get%s", $curr)));
 
                                // Add this item to the container list
                                $containerInstance->append(array(