From 9729036e26e672e07f677667ad477c33c7d1caf0 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 8 Feb 2019 17:19:56 +0100 Subject: [PATCH] Added new function getData to helper hlp_message_helper.php --- application/helpers/hlp_message_helper.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/helpers/hlp_message_helper.php b/application/helpers/hlp_message_helper.php index 1197a02ac..c8bbcaf87 100644 --- a/application/helpers/hlp_message_helper.php +++ b/application/helpers/hlp_message_helper.php @@ -82,6 +82,21 @@ function hasData($result) return false; } +/** + * Returns the property retval if $result contains data + */ +function getData($result) +{ + $data = null; + + if (hasData($result)) + { + $data = $result->retval; + } + + return $data; +} + /** * Checks if the result represents an error * Wrapper function of isSuccess, more readable code