\Iqrf\Repository\Entities\Metadata PersistentQuantity

PersistentQuantity metadata entity

Summary

Methods
Properties
Constants
__construct
fromApiResponse
jsonSerialize
quantity
value
description
memory
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

$quantity

$quantity : ?int

Type

int|null

$value

$value : ?int

Type

int|null

$description

$description : ?string

Type

string|null

Methods

__construct()

__construct(int|null  $quantity = null, int|null  $value = null, string|null  $description = null, \Iqrf\Repository\Entities\Metadata\PersistentQuantityMemory|null  $memory = null) : mixed

Constructs PersistentQuantity metadata object.

Parameters

int|null $quantity

Identifier of a quantity, sensor type value is used for this purpose.

int|null $value

Persisted value (in accordance with the IQRF standard)

string|null $description

Persistent quantity description and use case.

\Iqrf\Repository\Entities\Metadata\PersistentQuantityMemory|null $memory

Information about the type of memory and location in said memory for persistent quantity.

Returns

mixed —

fromApiResponse()

fromApiResponse(array{quantity?: int, value?: int, description?: string, memory?: array{type?: int, addr?: int}}  $response) : \Iqrf\Repository\Entities\Metadata\PersistentQuantity

Parses the provided response data into a PersistentQuantity object

Parameters

array{quantity?: int, value?: int, description?: string, memory?: array{type?: int, addr?: int}} $response

API response body

Returns

\Iqrf\Repository\Entities\Metadata\PersistentQuantity —

The parsed PersistentQuantity object

jsonSerialize()

jsonSerialize() : array{quantity?: int, value?: int, description?: string, memory?: array{type?: int, addr?: int}}

Serializes ActionRecord entity into JSON

Returns

array{quantity?: int, value?: int, description?: string, memory?: array{type?: int, addr?: int}} —

JSON-serialized ActionRecord entity