Listing & form

- improved Listing in order to make it more DRY
- form builder with all field types
- added support for data array in ValidModel->set()
- updated models to comply with Listing & Form methods
This commit is contained in:
Jonathan Labreuille
2015-09-14 19:07:41 +02:00
parent e471d45827
commit 79f1896cf3
19 changed files with 451 additions and 272 deletions

View File

@@ -80,10 +80,18 @@ class Subscriber extends Model {
if($subscriber === false) {
$subscriber = self::create();
$subscriber->hydrate($data);
} else {
unset($data['id']);
$subscriber->set($data);
}
$subscriber->hydrate($data);
return $subscriber->save();
$saved = $subscriber->save();
if($saved === false) {
return $subscriber->getValidationErrors();
} else {
return true;
}
}
}