bugfix + refactoring

This commit is contained in:
Jonathan Labreuille
2016-03-01 16:23:15 +01:00
parent 82ed7e51c5
commit 12c159c627
7 changed files with 281 additions and 232 deletions

View File

@@ -88,18 +88,10 @@ class Subscribers {
}
$subscriber = Subscriber::subscribe($data, $segment_ids);
$result = false;
if($subscriber === false || !$subscriber->id()) {
$errors = array_merge($errors, $subscriber->getValidationErrors());
} else {
$result = true;
}
if(!empty($errors)) {
if($subscriber->getErrors() !== false) {
return array(
'result' => false,
'errors' => $errors
'errors' => $subscriber->getErrors()
);
}