Table of Contents
๐ฆ Class \counteritems
/**
* container for all counters of a single app
* store last N response time to draw a graph
*
* @example
* <code>
* // INIT
* $oCounters=new counteritems($sAppId, $sCounterId);
* OR
* $oCounters=new counteritems();
* $oCounters->setApp($sAppId);
* $oCounters->setCounter($sCounterId);
*
* // ADD VALUE
* $oCounters->add([array]);
*
* </code>
*
* @author hahn
*
* 2024-07-17 axel.hahn@unibe.ch php 8 only: use typed variables
*/
๐ถ Properties
(none)
๐ท Methods
๐น public __construct()
Constructur with optional app and counter @see settApp
Return: ``
Parameters: 2
Parameter | Type | Description |
---|---|---|
<optional> string $sAppid = โโ | string |
optional: id of an app |
<optional> string $sCounterId = โโ | string |
optional: name of a counter |
๐น public add()
Add a value to the current counter
Return: bool
Parameters: 1
Parameter | Type | Description |
---|---|---|
<required> array $aItem | array |
array item to add |
๐น public delete()
Delete all application counters
Return: bool
Parameters: 0
๐น public deleteCounter()
Delete a single counter history
Return: bool
Parameters: 1
Parameter | Type | Description |
---|---|---|
<optional> string $sCounterId = โโ | string |
delete data of another than the current counter id |
๐น public get()
Get last N values
Return: array
Parameters: 1
Parameter | Type | Description |
---|---|---|
<optional> int $iMax = 0 | int |
optional: get last N values; default: get all stored values |
๐น public getCounters()
Get all stored counters of the current app
Return: array
Parameters: 0
๐น public setApp()
Set application id
Return: bool
Parameters: 2
Parameter | Type | Description |
---|---|---|
<required> string $sAppid | string |
id of an app |
<optional> string $sCounterId = โโ | string |
optional: name of a counter |
๐น public setCounter()
Set counter name
Return: boolean *
Parameters: 2
Parameter | Type | Description |
---|---|---|
<required> string $sCounterId | string |
name of a counter |
<optional> array $aMeta = [] | array |
metadata with these keys - title - text above value - visual - visualisation type |
Generated with Axels PHP class doc parser.