Always count WP user list towards the limit

[MAILPOET-3143]
This commit is contained in:
Rostislav Wolny
2021-01-06 15:53:35 +01:00
committed by Veljko V
parent 8de40ffb99
commit 86add53c30
3 changed files with 2 additions and 27 deletions

View File

@ -37,24 +37,6 @@ class SubscribersRepository extends Repository {
return (int)$query->getSingleScalarResult();
}
/**
* @return int
*/
public function getTotalSubscribersWithoutWPUsers() {
$query = $this->entityManager
->createQueryBuilder()
->select('count(n.id)')
->from(SubscriberEntity::class, 'n')
->where('n.deletedAt IS NULL AND n.status IN (:statuses) AND n.wpUserId IS NULL')
->setParameter('statuses', [
SubscriberEntity::STATUS_SUBSCRIBED,
SubscriberEntity::STATUS_UNCONFIRMED,
SubscriberEntity::STATUS_INACTIVE,
])
->getQuery();
return (int)$query->getSingleScalarResult();
}
public function findBySegment(int $segmentId): array {
return $this->entityManager
->createQueryBuilder()