From 609813185124b3f7ed074f13763d103383dda030 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Sun, 13 Jun 2021 19:35:46 +0200 Subject: [PATCH] [TASK] Add object utility --- Classes/Utility/ObjectUtility.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Classes/Utility/ObjectUtility.php diff --git a/Classes/Utility/ObjectUtility.php b/Classes/Utility/ObjectUtility.php new file mode 100644 index 0000000..ec4496a --- /dev/null +++ b/Classes/Utility/ObjectUtility.php @@ -0,0 +1,30 @@ + + * + ***/ + +/** + * + */ +class ObjectUtility +{ + /** + * fills object from array + * + * @return void + */ + public static function fromArray(&$object, $data) { + foreach ($data as $property => $value) { + $object->_setProperty($property, $value); + } + } +}