From b3b7f0aed8708b7e39979bd8ddcf051943e10137 Mon Sep 17 00:00:00 2001 From: ngleader Date: Mon, 25 Nov 2013 22:06:23 +0900 Subject: [PATCH] NOISSUE, trivial code change --- classes/object/Object.class.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/classes/object/Object.class.php b/classes/object/Object.class.php index e6ca0331c..aadf61e72 100644 --- a/classes/object/Object.class.php +++ b/classes/object/Object.class.php @@ -96,9 +96,14 @@ class Object */ function setMessage($message = 'success') { - if(Context::getLang($message)) - $message = Context::getLang($message); - $this->message = $message; + if($str = Context::getLang($message)) + { + $this->message = $str; + } + else + { + $this->message = $message; + } // TODO This method always returns True. We'd better remove it return TRUE; @@ -166,12 +171,11 @@ class Object */ function gets() { - $num_args = func_num_args(); - $args_list = func_get_args(); - for($i = 0; $i < $num_args; $i++) + $args = func_get_args(); + $output = new stdClass(); + foreach($args as $arg) { - $key = $args_list[$i]; - $output->{$key} = $this->get($key); + $output->{$arg} = $this->get($arg); } return $output; } @@ -209,7 +213,7 @@ class Object function toBool() { // TODO This method is misleading in that it returns true if error is 0, which should be true in boolean representation. - return $this->error == 0 ? TRUE : FALSE; + return ($this->error == 0); } /**