aboutsummaryrefslogtreecommitdiff
path: root/app/class/dbitem.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/class/dbitem.php')
-rw-r--r--app/class/dbitem.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/class/dbitem.php b/app/class/dbitem.php
index ff41d6f..2035316 100644
--- a/app/class/dbitem.php
+++ b/app/class/dbitem.php
@@ -2,7 +2,7 @@
class Dbitem
{
- public function hydrate(array $datas)
+ public function hydrate($datas)
{
foreach ($datas as $key => $value) {
$method = 'set' . $key;
@@ -13,6 +13,19 @@ class Dbitem
}
}
+
+ 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;
+ }
}