From 24f7177de1c59fd8eaea1c908c69f78b998fd0ff Mon Sep 17 00:00:00 2001 From: Ali Shahidi Date: Mon, 4 Jul 2022 03:55:58 +0430 Subject: [PATCH] add some helper function --- system/Helpers/Helpers.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/Helpers/Helpers.php b/system/Helpers/Helpers.php index b2f8766..12f6509 100755 --- a/system/Helpers/Helpers.php +++ b/system/Helpers/Helpers.php @@ -449,6 +449,17 @@ function estimateReadingTimePrintPersian($ms) } } +if (!function_exists("objectToArray")) { + function objectToArray($object, $name) + { + $returnArray = []; + foreach($object as $obj){ + array_push($returnArray, $obj->{$name}); + } + return $returnArray; + } +} + function paginateViewRouteGenerator($routeUrl, $pageCount) { if (isset($_GET[0]))