๐Ÿ“ฆ 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.