From c276283d9f73e6059630cb96fcddc8da55eb5eb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2013 12:44:17 +0200 Subject: [PATCH] New: Add errorsToString function --- htdocs/core/class/commonobject.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3e0002d686d..1bb675a6a0b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -51,6 +51,16 @@ abstract class CommonObject // No constructor as it is an abstract class + /** + * Method to output saved errors + * + * @return string String with errors + */ + function errorsToString() + { + return $this->error.(is_array($this->errors)?(($this->error!=''?' ':'').join(',',$this->errors)):''); + } + /** * Return full name (civility+' '+name+' '+lastname) *