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

File model holding information about a single file. More...

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

Public Member Functions

 __construct ($hash)
 
 getHash ()
 
 getFindings ()
 
 getUploads ()
 
 getMessage ()
 
 setHash ($hash)
 
 setFindings ($findings)
 
 setUploads ($uploads)
 
 setMessage ($message)
 
 getArray ()
 

Static Public Member Functions

static parseFromArray ($inputList)
 

Public Attributes

const NOT_FOUND = "Not found"
 
const INVALID = "Invalid keys"
 

Private Attributes

 $hash
 
 $findings
 
 $uploads
 
 $message
 

Detailed Description

File model holding information about a single file.

Definition at line 18 of file File.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\UI\Api\Models\File::__construct (   $hash)

File constructor.

Parameters
Hash$hash

Definition at line 57 of file File.php.

Member Function Documentation

◆ getArray()

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

Get the file element as associative array

Do not return findings and uploads if message is NOT_FOUND or INVALID.

Returns
array

Definition at line 149 of file File.php.

◆ getFindings()

Fossology\UI\Api\Models\File::getFindings ( )
Returns
Findings|null If message is NOT_FOUND or INVALID, returns null, findings otherwise

Definition at line 77 of file File.php.

◆ getHash()

Fossology\UI\Api\Models\File::getHash ( )
Returns
Hash

Definition at line 68 of file File.php.

◆ getMessage()

Fossology\UI\Api\Models\File::getMessage ( )
Returns
string

Definition at line 99 of file File.php.

◆ getUploads()

Fossology\UI\Api\Models\File::getUploads ( )
Returns
array|null

Definition at line 88 of file File.php.

◆ parseFromArray()

static Fossology\UI\Api\Models\File::parseFromArray (   $inputList)
static

Parse a list of hashes and generate array of File objects.

Parameters
array$inputListArray of hashes to parse
Returns
File[] Array of files
See also
Fossology::UI::Api::Models::Hash::createFromArray()

Definition at line 169 of file File.php.

◆ setFindings()

Fossology\UI\Api\Models\File::setFindings (   $findings)
Parameters
Findings$findings

Definition at line 115 of file File.php.

◆ setHash()

Fossology\UI\Api\Models\File::setHash (   $hash)
Parameters
Hash$hash

Definition at line 107 of file File.php.

◆ setMessage()

Fossology\UI\Api\Models\File::setMessage (   $message)
Parameters
string$message

Definition at line 138 of file File.php.

◆ setUploads()

Fossology\UI\Api\Models\File::setUploads (   $uploads)
Parameters
array$uploads

Definition at line 123 of file File.php.

Member Data Documentation

◆ $findings

Findings File::$findings
private

Findings about the file

Definition at line 41 of file File.php.

◆ $hash

Hash File::$hash
private

Hash info of the file

Definition at line 36 of file File.php.

◆ $message

string File::$message
private

Message associated with the file

Definition at line 51 of file File.php.

◆ $uploads

array File::$uploads
private

Upload IDs the file belongs to

Definition at line 46 of file File.php.


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