Major refactoring of listing/router/model relation

- updated Subscribers listing
- udpated Segments listing
- added Forms router
This commit is contained in:
Jonathan Labreuille
2015-10-29 15:30:24 +01:00
parent 103da61d45
commit a4cf2f9c76
20 changed files with 662 additions and 643 deletions

View File

@@ -18,7 +18,11 @@ $models = array(
'SubscriberSegment'
);
$destroy = function ($model) {
Model::factory('\MailPoet\Models\\' . $model)
->deleteMany();
$class = new \ReflectionClass('\MailPoet\Models\\' . $model);
$table = $class->getStaticPropertyValue('_table');
$db = ORM::getDb();
$db->beginTransaction();
$db->exec('TRUNCATE '.$table);
$db->commit();
};
array_map($destroy, $models);