From 7bf20e29e7c2d41f012360287fc972d19671f5ac Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 7 May 2013 11:52:44 +0000 Subject: [PATCH] Update Database::throwException function Now it returns previous set value. --- src/messenger/webim/libs/classes/database.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/messenger/webim/libs/classes/database.php b/src/messenger/webim/libs/classes/database.php index aeae25dc..0f90cc90 100644 --- a/src/messenger/webim/libs/classes/database.php +++ b/src/messenger/webim/libs/classes/database.php @@ -217,11 +217,21 @@ Class Database{ } /** - * Set if exceptions must be process into the class or thrown. - * @param boolean $value + * Set if exceptions must be process into the class or thrown and return + * previous value. + * + * If called without arguments just return previous value without changing + * anything. + * + * @param boolean $value Value that should be set. This argument is optional + * @return bool Previous value */ - public function throwExeptions($value){ - $this->throwExceptions = $value; + public function throwExeptions(){ + $last_value = $this->throwExceptions; + if (func_num_args() > 0) { + $this->throwExceptions = func_get_arg(0); + } + return $last_value; } /**