From e802d5204b96d645ec3d40b81b4a8bdc6e0ee675 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Mon, 4 Nov 2019 23:31:31 +0100 Subject: refactor: switch to psr-4 autoloading --- app/class/Dbitem.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/class/Dbitem.php (limited to 'app/class/Dbitem.php') diff --git a/app/class/Dbitem.php b/app/class/Dbitem.php new file mode 100644 index 0000000..fb272b1 --- /dev/null +++ b/app/class/Dbitem.php @@ -0,0 +1,34 @@ + $value) { + $method = 'set' . $key; + + if (method_exists($this, $method)) { + $this->$method($value); + } + } + + } + + public function dry() + { + $array = []; + foreach (get_object_vars($this) as $var => $value) { + if (in_array($var, $this::VAR_DATE)) { + $array[$var] = $this->$var('string'); + } else { + $array[$var] = $this->$var(); + } + } + return $array; + } +} + + +?> \ No newline at end of file -- cgit v1.2.3