Move function to a better repository

[MAILPOET-2439]
This commit is contained in:
Pavel Dohnal
2019-10-30 13:36:04 +01:00
committed by Jack Kitterhing
parent bda3bd3f63
commit ab1e398241
5 changed files with 28 additions and 26 deletions

View File

@ -54,23 +54,5 @@ class StatsNotificationsRepository extends Repository {
return $query->getQuery()->getResult();
}
/**
* @return NewsletterEntity[]
*/
public function findScheduledAutomatedNewsletters() {
return $this->entity_manager
->createQueryBuilder()
->select('n')
->from(NewsletterEntity::class, 'n')
->where('n.status = :status')
->setParameter(':status', NewsletterEntity::STATUS_ACTIVE)
->andWhere('n.deleted_at is null')
->andWhere('n.type IN (:types)')
->setParameter('types', [NewsletterEntity::TYPE_AUTOMATIC, NewsletterEntity::TYPE_WELCOME])
->orderBy('n.subject')
->getQuery()
->getResult();
}
}