\Iqrf\Repository\EntitiesFile

File entity

Summary

Methods
Properties
Constants
__construct()
fromArray()
getName()
getSize()
getDate()
getSha256()
jsonSerialize()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$name
$size
$date
$sha256
N/A

Properties

$name

$name : string

Type

string — File name

$size

$size : int

Type

int — File size

$date

$date : \DateTime

Type

\DateTime — File creation date

$sha256

$sha256 : string

Type

string — SHA256 hash of the file

Methods

__construct()

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

Constructor

Parameters

string $name

File name

int $size

File size

int $date

File creation date

string $sha256

SHA256 hash of the file

Returns

mixed —

fromArray()

fromArray(array<string,int|string>  $data) : \Iqrf\Repository\Entities\File

Creates a new file entity from an array

Parameters

array $data

JSON data in an array

Returns

\Iqrf\Repository\Entities\File —

File entity

getName()

getName() : string

Returns the file name

Returns

string —

File name

getSize()

getSize() : int

Returns the file size

Returns

int —

File size

getDate()

getDate() : \DateTime

Returns the file creation date

Returns

\DateTime —

File creation date

getSha256()

getSha256() : string

Returns the SHA256 hash of the file

Returns

string —

SHA256 hash of the file

jsonSerialize()

jsonSerialize() : array<string,int|string>

Serializes the File entity into JSON

Returns

array

JSON serialized File entity