Display machine opens

[MAILPOET-3740]
This commit is contained in:
Pavel Dohnal
2021-08-25 13:42:25 +02:00
committed by Veljko V
parent 58a9e9580d
commit 464f23c82b
7 changed files with 67 additions and 35 deletions

View File

@@ -10,6 +10,9 @@ class NewsletterStatistics {
/** @var int */
private $openCount;
/** @var int */
private $machineOpens;
/** @var int */
private $unsubscribeCount;
@@ -27,49 +30,40 @@ class NewsletterStatistics {
$this->wooCommerceRevenue = $wooCommerceRevenue;
}
/**
* @return int
*/
public function getClickCount() {
public function getClickCount(): int {
return $this->clickCount;
}
/**
* @return int
*/
public function getOpenCount() {
public function getOpenCount(): int {
return $this->openCount;
}
/**
* @return int
*/
public function getUnsubscribeCount() {
public function getUnsubscribeCount(): int {
return $this->unsubscribeCount;
}
/**
* @return int
*/
public function getTotalSentCount() {
public function getTotalSentCount(): int {
return $this->totalSentCount;
}
/**
* @return WooCommerceRevenue|null
*/
public function getWooCommerceRevenue() {
public function getWooCommerceRevenue(): ?WooCommerceRevenue {
return $this->wooCommerceRevenue;
}
/**
* @return array
*/
public function asArray() {
public function setMachineOpens(int $machineOpens): void {
$this->machineOpens = $machineOpens;
}
public function getMachineOpens(): int {
return $this->machineOpens;
}
public function asArray(): array {
return [
'clicked' => (int)$this->clickCount,
'opened' => (int)$this->openCount,
'unsubscribed' => (int)$this->unsubscribeCount,
'clicked' => $this->clickCount,
'opened' => $this->openCount,
'machineOpens' => $this->machineOpens,
'unsubscribed' => $this->unsubscribeCount,
'revenue' => empty($this->wooCommerceRevenue) ? null : $this->wooCommerceRevenue->asArray(),
];
}