Class Stats
Commodity class to generate statistics of HRM usage.
Namespace: hrm\
stats
Package: hrm
Located at stats/Stats.php
Methods summary
public
|
#
__construct( string $username )
Constructs the Stats object.
Constructs the Stats object.
Parameters
- $username
Name of the user for whom statistics are returned;
if the user is the admin user, global statistics are returned.
|
public
boolean
|
#
isGraph( )
Returns true is the requested statistics generates a graph,
and false if it returns a text/table
Returns true is the requested statistics generates a graph,
and false if it returns a text/table
Returns
boolean True for graphs, false for text/table.
|
public
array
|
#
getAllDescriptiveNames( )
Returns an array with the descriptive names of all supported
statistics (e.g. to be used in a < select > element).
Returns an array with the descriptive names of all supported
statistics (e.g. to be used in a < select > element).
Returns
array Array of descriptive names of supported statistics.
|
public
string
|
#
getSelectedStatistics( )
Returns the descriptive name of the selected statistics.
Returns the descriptive name of the selected statistics.
Returns
string The descriptive name of the selected statistics.
|
public
|
#
setSelectedStatistics( string $descriptiveName )
Sets the selected statistics.
Sets the selected statistics.
If the input statistics name does not exist, the first statistics is
selected (i.e. the one with index 0).
Parameters
- $descriptiveName
- Descriptive name of the selected statistics.
|
public
string
|
#
getStatistics( )
Get the JS/PHP script to display the statistics.
Get the JS/PHP script to display the statistics.
This function call should be combined with a isGraph() call, to decide
whether the generated (JS) script should be passed on to the HighCharts
library or not.
Returns
string JS/PHP script to display the statistics.
|
public
string
|
#
getFromDate( )
Returns the date of the first implementation of statistics in HRM
Returns the date of the first implementation of statistics in HRM
Returns
string 2010-02-01.
|
public
string
|
#
getToDate( )
Gets the end of current month
Gets the end of current month
Returns
string Date in the format (YYYY-MM-DD).
|
public
array
|
#
getGroupNames( )
Gets an array of unique group names from the statistics table.
Gets an array of unique group names from the statistics table.
Returns
array Array of all unique group names.
|
public
|
#
setFromDateFilter( string $fromDate )
Sets the 'from date' for the date filter.
Sets the 'from date' for the date filter.
Parameters
- $fromDate
- 'From' date for the date filter.
|
public
|
#
setToDateFilter( string $toDate )
Sets the 'to date' for the date filter.
Sets the 'to date' for the date filter.
Parameters
- $toDate
- 'To' date for the date filter.
|
public
|
#
setGroupFilter( string $group )
Sets the group name for the group filter.
Sets the group name for the group filter.
Parameters
- $group
- Group name for the group filter.
|