refactored bulk actions & implemented bulk trash for all listings

This commit is contained in:
Jonathan Labreuille
2015-09-18 17:39:25 +02:00
parent cbcd614b6f
commit 239e2583d2
16 changed files with 259 additions and 160 deletions

View File

@@ -57,10 +57,18 @@ class Segment extends Model {
$saved = $segment->save();
if($saved === false) {
return $segment->getValidationErrors();
} else {
if($saved === true) {
return true;
} else {
$errors = $segment->getValidationErrors();
if(!empty($errors)) {
return $errors;
}
}
return false;
}
static function trash($listing) {
return $listing->getSelection()->deleteMany();
}
}