\Iqrf\Repository\Entities\Metadata Accumulator

Accumulator metadata entity

Summary

Methods
Properties
Constants
__construct
fromApiResponse
jsonSerialize
present
type
lowLevel
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$present

$present : bool

Type

bool

$type

$type : ?string

Type

string|null

$lowLevel

$lowLevel : ?float

Type

float|null

Methods

__construct()

__construct(bool  $present, string|null  $type = null, float|null  $lowLevel = null) : mixed

Constructs Accumulator metadata object.

Parameters

bool $present

Power supplied from an accumulator.

string|null $type

Accumulator type identifier.

float|null $lowLevel

Voltage (in V) threshold indicating a recharge is recommended.

Returns

mixed —

fromApiResponse()

fromApiResponse(array{present: bool, type: string|null, lowLevel: float|null}  $response) : \Iqrf\Repository\Entities\Metadata\Accumulator

Parses the provided response data into an Accumulator object

Parameters

array{present: bool, type: string|null, lowLevel: float|null} $response

API response body

Throws

\InvalidArgumentException

Thrown if required properties are missing

Returns

\Iqrf\Repository\Entities\Metadata\Accumulator —

The parsed Accumulator object

jsonSerialize()

jsonSerialize() : array{present: bool, type: string|null, lowLevel: float|null}

Serializes the Accumulator entity into JSON

Returns

array{present: bool, type: string|null, lowLevel: float|null} —

JSON-serialized Accumulator data