Refactor to Doctrine

[MAILPOET-3765]
This commit is contained in:
Pavel Dohnal
2021-09-06 13:38:02 +02:00
committed by Veljko V
parent 995b716fe3
commit db04687f3c
3 changed files with 33 additions and 9 deletions

View File

@@ -329,4 +329,19 @@ class SubscribersRepository extends Repository {
$subscriberEntity->setLastEngagementAt($now);
$this->flush();
}
/**
* @param array $ids
* @return string[]
*/
public function getUndeletedSubscribersEmailsByIds(array $ids): array {
return $this->entityManager->createQueryBuilder()
->select('s.email')
->from(SubscriberEntity::class, 's')
->where('s.deletedAt IS NULL')
->andWhere('s.id IN (:ids)')
->setParameter('ids', $ids)
->getQuery()
->getArrayResult();
}
}