FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Models\Hash Class Reference

Hash model holding information about file like checksums and size. More...

Collaboration diagram for Fossology\UI\Api\Models\Hash:
Collaboration graph

Public Member Functions

 __construct ($sha1=null, $md5=null, $sha256=null, $size=null)
 
 getSha1 ()
 
 getSha256 ()
 
 getMd5 ()
 
 getSize ()
 
 getArray ()
 

Static Public Member Functions

static createFromArray ($inputArray)
 

Public Attributes

const ALLOWED_KEYS = ['sha1', 'sha256', 'md5', 'size']
 

Private Attributes

 $sha1
 
 $sha256
 
 $md5
 
 $size
 

Detailed Description

Hash model holding information about file like checksums and size.

Definition at line 17 of file Hash.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\UI\Api\Models\Hash::__construct (   $sha1 = null,
  $md5 = null,
  $sha256 = null,
  $size = null 
)

Hash constructor.

Parameters
string$sha1SHA1 checksum
string$md5MD5 checksum
string$sha256SHA256 checksum
integer$sizeSize of the file in bytes

Definition at line 58 of file Hash.php.

Member Function Documentation

◆ createFromArray()

static Fossology\UI\Api\Models\Hash::createFromArray (   $inputArray)
static

Creates Hash object from given array. If the input array contains additional keys, return NULL.

Parameters
array$inputArrayArray to parse
Returns
NULL|Hash NULL if input contains additional keys, Hash otherwise

Definition at line 125 of file Hash.php.

◆ getArray()

Fossology\UI\Api\Models\Hash::getArray ( )

Get the object as associative array

Returns
array

Definition at line 108 of file Hash.php.

◆ getMd5()

Fossology\UI\Api\Models\Hash::getMd5 ( )
Returns
string

Definition at line 90 of file Hash.php.

◆ getSha1()

Fossology\UI\Api\Models\Hash::getSha1 ( )
Returns
string

Definition at line 74 of file Hash.php.

◆ getSha256()

Fossology\UI\Api\Models\Hash::getSha256 ( )
Returns
string

Definition at line 82 of file Hash.php.

◆ getSize()

Fossology\UI\Api\Models\Hash::getSize ( )
Returns
number

Definition at line 98 of file Hash.php.

Member Data Documentation

◆ $md5

string Fossology\UI\Api\Models\Hash::$md5
private

MD5 checksum

Definition at line 42 of file Hash.php.

◆ $sha256

string Fossology\UI\Api\Models\Hash::$sha256
private

SHA256 checksum

Definition at line 36 of file Hash.php.

◆ $size

int Fossology\UI\Api\Models\Hash::$size
private

Size in bytes

Definition at line 48 of file Hash.php.


The documentation for this class was generated from the following file: