From fc4f5d9af214e0e8af36ca2b48a2beb58b352d54 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 12:25:00 +0200 Subject: [PATCH] adding abstract function in Stats class --- htdocs/core/class/stats.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 91d3d729c2f..38effddb586 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -219,6 +219,13 @@ abstract class Stats return $data; } + /** + * @param int $year year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getAverageByMonth($year, $format = 0); + /** * Return average of entity by month for several years * @@ -236,7 +243,7 @@ abstract class Stats $year = $startyear; while ($year <= $endyear) { - $datay[$year] = $this->_getAverageByMonth($year); + $datay[$year] = $this->getAverageByMonth($year); $year++; }