From 607a5de8690fb532bfa0421d16daa02bc304c1a0 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Wed, 30 May 2012 07:45:15 +0000 Subject: [PATCH] * adjust errors function. --- lib/dao/dao.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index 79913937f6..2cdda2e726 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -944,14 +944,26 @@ class dao /** * Get the errors. * + * @param boolean $join * @access public * @return array */ - public function getError() + public function getError($join = false) { $errors = dao::$errors; dao::$errors = array(); // Must clear it. - return $errors; + + if(!$join) return $errors; + + if(is_array($errors)) + { + $message = ''; + foreach($errors as $item) + { + is_array($item) ? $message .= join('\n', $item) . '\n' : $message .= $item . '\n'; + } + return $message; + } } /**