Pass revenues in stats response

[MAILPOET-3069]
This commit is contained in:
Pavel Dohnal
2020-08-10 10:58:57 +02:00
committed by Veljko V
parent 24c5ff8cb1
commit 58eb27457c
4 changed files with 72 additions and 4 deletions

View File

@@ -2,6 +2,8 @@
namespace MailPoet\Subscribers\Statistics;
use MailPoet\Newsletter\Statistics\WooCommerceRevenue;
class SubscriberStatistics {
/** @var int */
@@ -13,10 +15,14 @@ class SubscriberStatistics {
/** @var int */
private $totalSentCount;
public function __construct($clickCount, $openCount, $totalSentCount) {
/** @var WooCommerceRevenue|null */
private $wooCommerceRevenue;
public function __construct($clickCount, $openCount, $totalSentCount, $wooCommerceRevenue = null) {
$this->clickCount = $clickCount;
$this->openCount = $openCount;
$this->totalSentCount = $totalSentCount;
$this->wooCommerceRevenue = $wooCommerceRevenue;
}
/**
@@ -39,4 +45,11 @@ class SubscriberStatistics {
public function getTotalSentCount(): int {
return $this->totalSentCount;
}
/**
* @return WooCommerceRevenue|null
*/
public function getWooCommerceRevenue() {
return $this->wooCommerceRevenue;
}
}