\Iqrf\Repository\Entities MetadataProfilePowerSupply

Metadata profile power supply entity

Summary

Methods
Properties
Constants
__construct
fromApiResponse
getSchema
jsonSerialize
mains
accumulator
battery
minVoltage
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

$mains

$mains : bool

Type

bool

$minVoltage

$minVoltage : float

Type

float

Methods

__construct()

__construct(bool  $mains, \Iqrf\Repository\Entities\MetadataProfilePowerSupplyAccumulator  $accumulator, \Iqrf\Repository\Entities\MetadataProfilePowerSupplyBattery  $battery, float  $minVoltage) : mixed

Constructor

Parameters

bool $mains

Mains power supply

\Iqrf\Repository\Entities\MetadataProfilePowerSupplyAccumulator $accumulator

Accumulator power supply

\Iqrf\Repository\Entities\MetadataProfilePowerSupplyBattery $battery

Battery power supply

float $minVoltage

Minimum operating voltage

Returns

mixed —

fromApiResponse()

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

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\MetadataProfilePowerSupply —

New entity

getSchema()

getSchema() : \Nette\Schema\Schema

Get entity validation schema

Returns

\Nette\Schema\Schema —

Validation schema

jsonSerialize()

jsonSerialize() : array{mains: bool, accumulator: array<string,mixed>, battery: array<string,mixed>, minVoltage: float}

Serializes the entity to JSON

Returns

array{mains: bool, accumulator: array, battery: array, minVoltage: float} —

JSON-serialized entity