Make method more clear

[MAILPOET-2439]
This commit is contained in:
Pavel Dohnal
2019-10-30 10:53:25 +01:00
committed by Jack Kitterhing
parent f1934ff880
commit 5b6b21b23f
3 changed files with 7 additions and 10 deletions

View File

@@ -65,7 +65,7 @@ class Scheduler {
if (!in_array($newsletter->getType(), $this->supported_types)) {
return false;
}
if ($this->isTaskScheduled($newsletter->getId())) {
if ($this->hasTaskBeenScheduled($newsletter->getId())) {
return false;
}
return true;
@@ -91,9 +91,9 @@ class Scheduler {
return !(bool)$settings['enabled'];
}
private function isTaskScheduled($newsletter_id) {
private function hasTaskBeenScheduled($newsletter_id) {
$existing = $this->repository->findByNewsletterId($newsletter_id);
return count($existing) > 0;
return $existing instanceof StatsNotificationEntity;
}
private function getNextRunDate() {