Let the statisticsForms model return the total signups instead of the form model
- added unit test for getTotalSignups() method
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace MailPoet\Router;
|
||||
use \MailPoet\Models\Form;
|
||||
use \MailPoet\Models\StatisticsForms;
|
||||
use \MailPoet\Form\Renderer as FormRenderer;
|
||||
use \MailPoet\Listing;
|
||||
use \MailPoet\Form\Util;
|
||||
@ -29,9 +30,9 @@ class Forms {
|
||||
|
||||
// fetch segments relations for each returned item
|
||||
foreach($listing_data['items'] as $key => $form) {
|
||||
$form = $form
|
||||
->withSignups()
|
||||
->asArray();
|
||||
$form = $form->asArray();
|
||||
|
||||
$form['signups'] = StatisticsForms::getTotalSignups($form['id']);
|
||||
|
||||
$form['segments'] = (
|
||||
!empty($form['settings']['segments'])
|
||||
|
Reference in New Issue
Block a user