\Iqrf\Repository\Entities Product

Product entity

Summary

Methods
Properties
Constants
__construct
fromApiResponse
jsonSerialize
hwpid
name
manufacturerId
companyName
homepage
picture
rfMode
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

$hwpid

$hwpid : int

Type

int

$name

$name : string

Type

string

$manufacturerId

$manufacturerId : int

Type

int

$companyName

$companyName : string

Type

string

$homepage

$homepage : string

Type

string

$picture

$picture : string

Type

string

$rfMode

$rfMode : \Iqrf\Repository\Enums\RfModes

Type

RfModes

Methods

__construct()

__construct(int  $hwpid, string  $name, int  $manufacturerId, string  $companyName, string  $homepage, string  $picture, \Iqrf\Repository\Enums\RfModes  $rfMode) : mixed

Constructor

Parameters

int $hwpid

Product HWPID

string $name

Product name

int $manufacturerId

Manufacturer ID

string $companyName

Company name

string $homepage

Product homepage

string $picture

Product picture

\Iqrf\Repository\Enums\RfModes $rfMode

Product RF mode

Returns

mixed —

fromApiResponse()

fromApiResponse(array{hwpid: int, name: string, manufacturerID: int, companyName: string, homePage: string, picture: string, rfMode: int}  $response) : \Iqrf\Repository\Entities\Product

Creates a new product entity from the API response

Parameters

array{hwpid: int, name: string, manufacturerID: int, companyName: string, homePage: string, picture: string, rfMode: int} $response

API response data

Throws

\Iqrf\Repository\Exceptions\CorruptedData

Thrown when the API response data are corrupted

Returns

\Iqrf\Repository\Entities\Product —

Created product entity

jsonSerialize()

jsonSerialize() : array{hwpid: int, name: string, manufacturerId: int, companyName: string, homepage: string, picture: string, rfMode: string}

Serializes the product entity into JSON

Returns

array{hwpid: int, name: string, manufacturerId: int, companyName: string, homepage: string, picture: string, rfMode: string} —

JSON serialized product entity