AdherentStats
class AdherentStats extends Stats (View source)
Class to manage statistics of members
Properties
| protected DoliDB | $db | from Stats | |
| protected array<string, int> | $lastfetchdate | from Stats | |
| string | $cachefilesuffix | from Stats | |
| string | $from | ||
| string | $where | ||
| string | $from_line | from Stats | |
| string | $field_date | from Stats | |
| string | $field | ||
| string | $field_line | from Stats | |
| string | $error | from Stats | |
| int | $year | from Stats | |
| int | $month | from Stats | |
| string | $table_element | ||
| int | $memberid | ||
| int | $socid | ||
| int | $userid |
Methods
Return the number of members by month for a given year
Return nb of elements by month for several years
Return the number of subscriptions by month for a given year
Return amount of elements by month for several years.
Return average amount each month
Return average of entity by month for several years
Return count, and sum of products
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
Return the number of subscriptions by year
Return nb, total and average
Return count of member by status group by adh type, total and average
Return count of member by status group by adh type, total and average
Return array of last modified members
Details
array<int<0, 11>, array{0: int<1, 12>, 1: int}>
getNbByMonth(int $year, int $format = 0)
Return the number of members by month for a given year
in
Stats at line 106
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
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAmountByMonth(int $year, int $format = 0)
Return the number of subscriptions by month for a given year
in
Stats at line 208
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.
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAverageByMonth(int $year)
Return average amount each month
in
Stats at line 303
array<array<int|float>>
getAverageByMonthWithPrevYear(int $endyear, int $startyear)
Return average of entity by month for several years
in
Stats at line 338
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
in
Stats at line 408
protected array<array{0: int, 1: int}>
_getNbByYear(string $sql)
Return nb of elements by year
in
Stats at line 437
protected
_getAllByYear(string $sql)
Return nb of elements, total amount and avg amount each year
in
Stats at line 494
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
in
Stats at line 551
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
in
Stats at line 608
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
in
Stats at line 665
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
in
Stats at line 704
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
in
Stats at line 732
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
__construct(DoliDB $db, int $socid = 0, int $userid = 0)
Constructor
array<array{0: int, 1: int}>
getNbByYear()
Return the number of subscriptions by year
getAllByYear()
Return nb, total and average
@return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array with nb, total amount, average for each year
array<int|string, array{label: string, members_draft: int, members_pending: int, members_uptodate: int, members_expired: int, members_excluded: int, members_resiliated: int, all?: float|int, total_adhtype: float|int}>
countMembersByTypeAndStatus(int $numberYears = 0)
Return count of member by status group by adh type, total and average
array<string, array{label: string, members_draft: int, members_pending: 0, members_uptodate: int, members_expired: int, members_excluded: int, members_resiliated: int, all?: float|int, total_adhtag: float|int}>
countMembersByTagAndStatus(int $numberYears = 0)
Return count of member by status group by adh type, total and average
array<int, array{id: int, ref: string, firstname: string, lastname: string, company: string, fk_soc: ?int, datec: int|"", datem: int|"", status: int, date_end_subscription: int|"", photo: null|string, email: string, gender: string, morphy: string, typeid: int, need_subscription: 0|1|null, subscription: "0"|"1"|null, label: string}>
getLastModifiedMembers(int $max = 0)
Return array of last modified members