aboutsummaryrefslogtreecommitdiff
path: root/app/class/Item.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-04-14 16:36:45 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-04-14 16:36:45 +0200
commit8ccc4ac00c974ba3659762e6c67f75ed82020e37 (patch)
treefc9a5b656ca13b34cb2eaac6e909b0b59ca839e8 /app/class/Item.php
parentce3fcb72f2d5d154461a14183069bf87db1e5776 (diff)
downloadwcms-8ccc4ac00c974ba3659762e6c67f75ed82020e37.tar.gz
wcms-8ccc4ac00c974ba3659762e6c67f75ed82020e37.zip
finish flashmessages implementation
+ clean css
Diffstat (limited to 'app/class/Item.php')
-rw-r--r--app/class/Item.php12
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;
+ }
}