From 26f2f735103cb6aaeaa7da2594a956614b6b361c Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 11 Mar 2022 16:24:47 +0100 Subject: [PATCH] Introduce common `DataExtractor` trait --- library/Icinga/Common/DataExtractor.php | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 library/Icinga/Common/DataExtractor.php diff --git a/library/Icinga/Common/DataExtractor.php b/library/Icinga/Common/DataExtractor.php new file mode 100644 index 000000000..ed77115a9 --- /dev/null +++ b/library/Icinga/Common/DataExtractor.php @@ -0,0 +1,37 @@ + $value) { + $func = 'set'. ucfirst($name); + if (method_exists($this, $func)) { + $this->$func($value); + } + } + + return $this; + } + + /** + * Get this class's structure as array + * + * @return array + */ + public function toArray() + { + return []; + } +}