Refactor MailPoet\Cron to use new settings
[MAILPOET-1757]
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace MailPoet\Cron;
|
||||
|
||||
use MailPoet\Models\Setting;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
@@ -16,8 +17,8 @@ class CronTrigger {
|
||||
const DEFAULT_METHOD = 'WordPress';
|
||||
const SETTING_NAME = 'cron_trigger';
|
||||
|
||||
function __construct() {
|
||||
$this->current_method = self::getCurrentMethod();
|
||||
function __construct(SettingsController $settingsController) {
|
||||
$this->current_method = $settingsController->get(self::SETTING_NAME . '.method');
|
||||
}
|
||||
|
||||
function init() {
|
||||
@@ -34,8 +35,4 @@ class CronTrigger {
|
||||
static function getAvailableMethods() {
|
||||
return self::$available_methods;
|
||||
}
|
||||
|
||||
static function getCurrentMethod() {
|
||||
return Setting::getValue(self::SETTING_NAME . '.method');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user