\Iqrf\Repository\EntitiesFiles

Files entity

Summary

Methods
Properties
Constants
__construct()
fromApiResponse()
jsonSerialize()
$timestamp
$version
$files
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$timestamp

$timestamp : \DateTime

Type

\DateTime

$version

$version : int

Type

int

$files

$files : array

Type

array

Methods

__construct()

__construct(\DateTime  $timestamp, int  $version, \Iqrf\Repository\Entities\File[]  $files) : mixed

Constructor

Parameters

\DateTime $timestamp

Timestamp

int $version

Format version

\Iqrf\Repository\Entities\File[] $files

Array of files

Returns

mixed —

fromApiResponse()

fromApiResponse(array{timestamp: int, timestampDateTime?: string, version: int, files: array{name: string, size: int, date: int, dateDateTime?: string, sha256: string}[]}  $response) : \Iqrf\Repository\Entities\Files

Creates a new files entity from the API response

Parameters

array{timestamp: int, timestampDateTime?: string, version: int, files: array{name: string, size: int, date: int, dateDateTime?: string, sha256: string}[]} $response

API response body

Returns

\Iqrf\Repository\Entities\Files —

Files entity

jsonSerialize()

jsonSerialize() : array{timestamp: string, version: int, files: array{name: string, size: int, creationDate: string, sha256: string}[]}

Serializes the files entity into JSON

Returns

array{timestamp: string, version: int, files: array{name: string, size: int, creationDate: string, sha256: string}[]} —

JSON serialized files entity