diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-04-14 16:36:45 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-04-14 16:36:45 +0200 |
commit | 8ccc4ac00c974ba3659762e6c67f75ed82020e37 (patch) | |
tree | fc9a5b656ca13b34cb2eaac6e909b0b59ca839e8 /app/class/Item.php | |
parent | ce3fcb72f2d5d154461a14183069bf87db1e5776 (diff) | |
download | wcms-8ccc4ac00c974ba3659762e6c67f75ed82020e37.tar.gz wcms-8ccc4ac00c974ba3659762e6c67f75ed82020e37.zip |
finish flashmessages implementation
+ clean css
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; + } } |