Rename functions
[MAILPOET-2439]
This commit is contained in:
committed by
Jack Kitterhing
parent
0b88eccc91
commit
cf08200c5d
@ -116,7 +116,7 @@ class AutomatedEmails extends SimpleWorker {
|
|||||||
|
|
||||||
protected function getNewsletters() {
|
protected function getNewsletters() {
|
||||||
$result = [];
|
$result = [];
|
||||||
$newsletters = $this->repository->getDueAutomatedNewsletters();
|
$newsletters = $this->repository->findScheduledAutomatedNewsletters();
|
||||||
foreach ($newsletters as $newsletter) {
|
foreach ($newsletters as $newsletter) {
|
||||||
$statistics = $this->newsletter_statistics_repository->getStatistics($newsletter);
|
$statistics = $this->newsletter_statistics_repository->getStatistics($newsletter);
|
||||||
if ($statistics->getTotalSentCount()) {
|
if ($statistics->getTotalSentCount()) {
|
||||||
|
@ -31,7 +31,7 @@ class StatsNotificationsRepository extends Repository {
|
|||||||
* @param int|null $limit
|
* @param int|null $limit
|
||||||
* @return StatsNotificationEntity[]
|
* @return StatsNotificationEntity[]
|
||||||
*/
|
*/
|
||||||
public function findDueTasks($limit = null) {
|
public function findScheduled($limit = null) {
|
||||||
$date = new Carbon();
|
$date = new Carbon();
|
||||||
$query = $this->doctrine_repository
|
$query = $this->doctrine_repository
|
||||||
->createQueryBuilder('stn')
|
->createQueryBuilder('stn')
|
||||||
@ -57,7 +57,7 @@ class StatsNotificationsRepository extends Repository {
|
|||||||
/**
|
/**
|
||||||
* @return NewsletterEntity[]
|
* @return NewsletterEntity[]
|
||||||
*/
|
*/
|
||||||
public function getDueAutomatedNewsletters() {
|
public function findScheduledAutomatedNewsletters() {
|
||||||
return $this->entity_manager
|
return $this->entity_manager
|
||||||
->createQueryBuilder()
|
->createQueryBuilder()
|
||||||
->select('n')
|
->select('n')
|
||||||
|
@ -76,7 +76,7 @@ class Worker {
|
|||||||
/** @throws \Exception */
|
/** @throws \Exception */
|
||||||
function process() {
|
function process() {
|
||||||
$settings = $this->settings->get(self::SETTINGS_KEY);
|
$settings = $this->settings->get(self::SETTINGS_KEY);
|
||||||
foreach (self::getDueTasks() as $stats_notification_entity) {
|
foreach ($this->repository->findScheduled(Sending::RESULT_BATCH_SIZE) as $stats_notification_entity) {
|
||||||
try {
|
try {
|
||||||
$extra_params = [
|
$extra_params = [
|
||||||
'meta' => $this->mailerMetaInfo->getStatsNotificationMetaInfo(),
|
'meta' => $this->mailerMetaInfo->getStatsNotificationMetaInfo(),
|
||||||
@ -93,13 +93,6 @@ class Worker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return StatsNotificationEntity[]
|
|
||||||
*/
|
|
||||||
private function getDueTasks() {
|
|
||||||
return $this->repository->findDueTasks(Sending::RESULT_BATCH_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function constructNewsletter(StatsNotificationEntity $stats_notification_entity) {
|
private function constructNewsletter(StatsNotificationEntity $stats_notification_entity) {
|
||||||
$newsletter = $stats_notification_entity->getNewsletter();
|
$newsletter = $stats_notification_entity->getNewsletter();
|
||||||
$link = $this->newsletter_link_repository->findTopLinkForNewsletter($newsletter->getId());
|
$link = $this->newsletter_link_repository->findTopLinkForNewsletter($newsletter->getId());
|
||||||
|
Reference in New Issue
Block a user