Add getChildrenCount()

[MAILPOET-2503]
This commit is contained in:
Amine Ben hammou
2020-02-03 11:28:25 +01:00
committed by Jack Kitterhing
parent a92af3095b
commit 0069380da6
2 changed files with 20 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class NewslettersResponseBuilder {
$data['totalSent'] = $this->newslettersStatsRepository->getTotalSentCount($newsletter);
}
if ($relation === self::RELATION_CHILDREN_COUNT) {
$data['childrenCount'] = count($newsletter->getChildren());
$data['childrenCount'] = $this->newslettersStatsRepository->getChildrenCount($newsletter);
}
if ($relation === self::RELATION_SCHEDULED) {
$data['totalScheduled'] = (int)SendingQueue::findTaskByNewsletterId($newsletter->getId())