diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-04-25 17:53:44 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-04-25 17:53:44 +0200 |
commit | 0efeef6b6693d62675ec8a45e73c71f69e0a0362 (patch) | |
tree | 4b86b3bd62217fc4c60e2827e30a45209ce82605 /app/class/Item.php | |
parent | bd16dc7c6fc630a6b59ca3b041dde146ab50c72b (diff) | |
parent | 385b3f4adf86606e03941171c136d8f2eb2b35c2 (diff) | |
download | wcms-0efeef6b6693d62675ec8a45e73c71f69e0a0362.tar.gz wcms-0efeef6b6693d62675ec8a45e73c71f69e0a0362.zip |
Merge branch master with implement-exception
Diffstat (limited to 'app/class/Item.php')
-rw-r--r-- | app/class/Item.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/class/Item.php b/app/class/Item.php index 8a8f2d6..a76e700 100644 --- a/app/class/Item.php +++ b/app/class/Item.php @@ -33,7 +33,7 @@ abstract class Item public function dry() { $array = []; - foreach ($this as $var => $value) { + foreach (get_object_vars($this) as $var => $value) { $array[$var] = $this->$var(); } return $array; @@ -74,13 +74,13 @@ abstract class Item } elseif ($option == 'date' || $option == 'sort') { return $this->$property; } elseif ($option == 'hrdi') { - $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); + $now = new DateTimeImmutable("now", timezone_open("Europe/Paris")); return hrdi($this->$property->diff($now)); } elseif ($option == 'pdate') { return $this->$property->format('Y-m-d'); } elseif ($option == 'ptime') { return $this->$property->format('H:i'); - } elseif ($option = 'dmy') { + } elseif ($option == 'dmy') { return $this->$property->format('d/m/Y'); } } else { |