diff options
Diffstat (limited to 'app/class/Item.php')
-rw-r--r-- | app/class/Item.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/class/Item.php b/app/class/Item.php index 8bd62d1..10d35d7 100644 --- a/app/class/Item.php +++ b/app/class/Item.php @@ -12,13 +12,21 @@ abstract class Item public function hydrate($datas = []) { + $error = 0; foreach ($datas as $key => $value) { $method = 'set' . $key; if (method_exists($this, $method)) { - $this->$method($value); + if($this->$method($value) === false) { + $error ++; + } } - } + } + if ($error > 0) { + return false; + } else { + return true; + } } |