\Iqrf\Repository\Entities MetadataProfilePowerSupplyBattery

Metadata profile battery power supply entity

Summary

Methods
Properties
Constants
__construct
fromApiResponse
getSchema
jsonSerialize
present
type
changeThreshold
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|null

Type

string|null

$changeThreshold

$changeThreshold : float|null

Type

float|null

Methods

__construct()

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

Constructor

Parameters

bool $present

Device has battery

string|null $type

Battery type

float|null $changeThreshold

Change threshold

Returns

mixed —

fromApiResponse()

fromApiResponse(array  $response) : \Iqrf\Repository\Entities\MetadataProfilePowerSupplyBattery

Creates a new entity from API response

Parameters

array $response

API response data

Throws

\Iqrf\Repository\Exceptions\CorruptedData

Thrown when API response data are corrupted

Returns

\Iqrf\Repository\Entities\MetadataProfilePowerSupplyBattery —

New entity

getSchema()

getSchema() : \Nette\Schema\Schema

Get entity valication schema

Returns

\Nette\Schema\Schema —

Validation schema

jsonSerialize()

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

Serializes the entity into JSON

Returns

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

JSON-serialized entity