\Iqrf\Repository\EntitiesFile

File entity

Summary

Methods
Properties
Constants
__construct()
fromApiResponse()
jsonSerialize()
$name
$size
$date
$sha256
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

Type

string — File name

$size

$size : int

Type

int

$date

$date : \DateTime

Type

\DateTime

$sha256

$sha256 : string

Type

string

Methods

__construct()

__construct(string  $name, int  $size, \DateTime  $date, string  $sha256) : mixed

Constructor

Parameters

string $name

File name

int $size

File size

\DateTime $date

File creation date

string $sha256

SHA256 hash of the file

Returns

mixed —

fromApiResponse()

fromApiResponse(array{name: string, size: int, date: int, dateDateTime?: string, sha256: string}  $response) : \Iqrf\Repository\Entities\File

Creates a new file entity from the API response

Parameters

array{name: string, size: int, date: int, dateDateTime?: string, sha256: string} $response

API response body

Returns

\Iqrf\Repository\Entities\File —

File entity

jsonSerialize()

jsonSerialize() : array{name: string, size: int, creationDate: string, sha256: string}

Serializes the File entity into JSON

Returns

array{name: string, size: int, creationDate: string, sha256: string} —

JSON serialized File entity