X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fextended%2Fclass_SerializationContainer.php;h=6d5c15de54fd078d2bf1014929174a0fc5ae1a97;hb=389f3abad52f9cde3323db5d3d187562fe801a71;hp=b212ccd5b47077358e9400ef36d9daf34a93a2c2;hpb=1f1f351e726dae5d4cd25b46639c2fcaa9e38661;p=hub.git diff --git a/inc/classes/main/extended/class_SerializationContainer.php b/inc/classes/main/extended/class_SerializationContainer.php index b212ccd5b..6d5c15de5 100644 --- a/inc/classes/main/extended/class_SerializationContainer.php +++ b/inc/classes/main/extended/class_SerializationContainer.php @@ -24,7 +24,7 @@ */ class SerializationContainer extends FrameworkArrayObject { /** - * Public constructor, if you like to have an object of this class... + * Protected constructor, must stay as public... *sigh* * * @return void */ @@ -39,9 +39,9 @@ class SerializationContainer extends FrameworkArrayObject { * hold the attributed and their values which we have specified in * the limitation object. * - * @param $limitInstance The instance to the object ObjectLimits - * @param $object The origin object. We don't touch it here. - * @return $containerInstance An instance of SerializationContainer + * @param $limitInstance The instance to the object ObjectLimits + * @param $object The origin object. We don't touch it here. + * @return $containerInstance An instance of SerializationContainer * @throws GetterNotFoundException If a getter was not found */ public final static function createSerializationContainer (ObjectLimits $limitInstance, FrameworkInterface $object) { @@ -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:
%s

\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(