Remove old Setting model usage from InactiveSubscribersController
[MAILPOET-2436]
This commit is contained in:
committed by
Jack Kitterhing
parent
e636562185
commit
06708e0065
@ -7,14 +7,21 @@ use MailPoet\Config\MP2Migrator;
|
||||
use MailPoet\Models\ScheduledTask;
|
||||
use MailPoet\Models\ScheduledTaskSubscriber;
|
||||
use MailPoet\Models\SendingQueue;
|
||||
use MailPoet\Models\Setting;
|
||||
use MailPoet\Models\StatisticsOpens;
|
||||
use MailPoet\Models\Subscriber;
|
||||
use MailPoet\Settings\SettingsRepository;
|
||||
|
||||
class InactiveSubscribersController {
|
||||
|
||||
private $inactives_task_ids_table_created = false;
|
||||
|
||||
/** @var SettingsRepository */
|
||||
private $settings_repository;
|
||||
|
||||
function __construct(SettingsRepository $settings_repository) {
|
||||
$this->settings_repository = $settings_repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $days_to_inactive
|
||||
* @param int $batch_size
|
||||
@ -185,10 +192,7 @@ class InactiveSubscribersController {
|
||||
}
|
||||
|
||||
private function getMP2MigrationDate() {
|
||||
$migration_complete = Setting::where('name', MP2Migrator::MIGRATION_COMPLETE_SETTING_KEY)->findOne();
|
||||
if ($migration_complete === false) {
|
||||
return null;
|
||||
}
|
||||
return new Carbon($migration_complete->created_at);
|
||||
$setting = $this->settings_repository->findOneByName(MP2Migrator::MIGRATION_COMPLETE_SETTING_KEY);
|
||||
return $setting ? Carbon::instance($setting->getCreatedAt()) : null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user