Fix code style and small bugs

[MAILPOET-2503]
This commit is contained in:
Amine Ben hammou
2020-01-21 14:38:07 +01:00
committed by Jack Kitterhing
parent 4fe760f4b1
commit a5679a5dbf
3 changed files with 13 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ class NewslettersResponseBuilder {
const RELATION_SCHEDULED = 'scheduled';
const RELATION_STATISTICS = 'statistics';
/** @var NewslettersStatsRepository */
/** @var NewsletterStatisticsRepository */
private $newslettersStatsRepository;
public function __construct(NewsletterStatisticsRepository $newslettersStatsRepository) {
@@ -65,9 +65,9 @@ class NewslettersResponseBuilder {
$data['childrenCount'] = count($newsletter->getChildren());
}
if ($relation === self::RELATION_SCHEDULED) {
$data['totalScheduled'] = (int)SendingQueue::findTaskByNewsletterId($this->id)
->where('tasks.status', SendingQueue::STATUS_SCHEDULED)
->count();
$data['totalScheduled'] = (int)SendingQueue::findTaskByNewsletterId($newsletter->getId())
->where('tasks.status', SendingQueue::STATUS_SCHEDULED)
->count();
}
if ($relation === self::RELATION_STATISTICS) {
$data['statistics'] = $this->newslettersStatsRepository->getStatistics($newsletter);