Stats
abstract class Stats (View source)
Parent class of statistics class
Properties
| protected DoliDB | $db | ||
| protected array<string, int> | $lastfetchdate | ||
| string | $cachefilesuffix | ||
| string | $from | ||
| string | $where | ||
| string | $from_line | ||
| string | $field_date | ||
| string | $field | ||
| string | $field_line | ||
| string | $error | ||
| int | $year | ||
| int | $month |
Methods
No description
Return nb of elements by month for several years
No description
Return amount of elements by month for several years.
No description
Return average of entity by month for several years
Return count, and sum of products
Return nb of elements by year
Return nb of elements, total amount and avg amount each year
Renvoie le nombre de documents par mois pour une annee donnee Return number of documents per month for a given year
Return the amount per month for a given year
Return the amount average par month for a given year
Return number or total of product refs
Returns the summed amounts per year for a given number of past years ending now
Return nb, amount of predefined product for year
Details
abstract protected array<int<0, 11>, array{0: int<1, 12>, 1: int}>
getNbByMonth(int $year, int $format = 0)
No description
array<int<0, 11>, array{0: int<1, 12>, 1: int}>
getNbByMonthWithPrevYear(int $endyear, int $startyear, int $cachedelay = 0, int $format = 0, int $startmonth = 1)
Return nb of elements by month for several years
abstract protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAmountByMonth(int $year, int $format = 0)
No description
array<int<0, 11>, array<string|int|float>>
getAmountByMonthWithPrevYear(int $endyear, int $startyear, int $cachedelay = 0, int $format = 0, int $startmonth = 1)
Return amount of elements by month for several years.
Criteria used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php The caller of class can add more filters into sql request by adding criteris into the $stats->where property just after calling constructor.
abstract protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAverageByMonth(int $year)
No description
array<array<int|float>>
getAverageByMonthWithPrevYear(int $endyear, int $startyear)
Return average of entity by month for several years
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAllByProductEntry(int $year, int $cachedelay = 0, int $limit = 10)
Return count, and sum of products
protected array<array{0: int, 1: int}>
_getNbByYear(string $sql)
Return nb of elements by year
protected
_getAllByYear(string $sql)
Return nb of elements, total amount and avg amount each year
protected array<int<0, 11>, array{0: int<1, 12>, 1: int}>
_getNbByMonth(int $year, string $sql, int<0, 2> $format = 0)
Renvoie le nombre de documents par mois pour une annee donnee Return number of documents per month for a given year
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
_getAmountByMonth(int $year, string $sql, int<0, 2> $format = 0)
Return the amount per month for a given year
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
_getAverageByMonth($year, string $sql, $format = 0)
Return the amount average par month for a given year
@param int $year Year
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
_getAllByProduct($sql, int $limit = 10)
Return number or total of product refs
@param string $sql SQL
protected array<int, array{0: int, 1: int}>
_getAmountByYear($sql)
Returns the summed amounts per year for a given number of past years ending now
@param string $sql SQL
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAllByProduct(int $year, $limit = 0)
Return nb, amount of predefined product for year