Skip to content

Commit cc1081e

Browse files
committed
fix: statistics fields initialization
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent a25a51d commit cc1081e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

app/Models/Foundation/Summit/SponsorStatistics.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ class SponsorStatistics extends SilverstripeBaseModel
5757
#[ORM\Column(name: 'DocumentsQty', type: 'integer')]
5858
private $documentsQty;
5959

60+
public function __construct()
61+
{
62+
parent::__construct();
63+
$this->formsQty = 0;
64+
$this->purchasesQty = 0;
65+
$this->pagesQty = 0;
66+
$this->documentsQty = 0;
67+
}
68+
6069
public function getSponsor(): Sponsor
6170
{
6271
return $this->sponsor;
@@ -74,7 +83,7 @@ public function clearSponsor(): void
7483

7584
public function getFormsQty(): int
7685
{
77-
return $this->formsQty ?? 0;
86+
return $this->formsQty;
7887
}
7988

8089
public function setFormsQty(int $formsQty): void
@@ -84,7 +93,7 @@ public function setFormsQty(int $formsQty): void
8493

8594
public function getPurchasesQty(): int
8695
{
87-
return $this->purchasesQty ?? 0;
96+
return $this->purchasesQty;
8897
}
8998

9099
public function setPurchasesQty(int $purchasesQty): void
@@ -94,7 +103,7 @@ public function setPurchasesQty(int $purchasesQty): void
94103

95104
public function getPagesQty(): int
96105
{
97-
return $this->pagesQty ?? 0;
106+
return $this->pagesQty;
98107
}
99108

100109
public function setPagesQty(int $pagesQty): void
@@ -104,7 +113,7 @@ public function setPagesQty(int $pagesQty): void
104113

105114
public function getDocumentsQty(): int
106115
{
107-
return $this->documentsQty ?? 0;
116+
return $this->documentsQty;
108117
}
109118

110119
public function setDocumentsQty(int $documentsQty): void

0 commit comments

Comments
 (0)