* adjust errors function.

This commit is contained in:
chencongzhi520@gmail.com
2012-05-30 07:45:15 +00:00
parent 636e179a16
commit 607a5de869
+14 -2
View File
@@ -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;
}
}
/**