FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Models\License Class Reference
Inheritance diagram for Fossology\UI\Api\Models\License:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Models\License:
Collaboration graph

Public Member Functions

 __construct ( $id, $shortName="", $fullName="", $text="", $url="", $obligations=null, $risk=null, $isCandidate=false)
 
 getJSON ()
 
 getArray ()
 
 getId ()
 
 getShortName ()
 
 getFullName ()
 
 getText ()
 
 getUrl ()
 
 getRisk ()
 
 getIsCandidate ()
 
 getObligations ()
 
 getMergeRequest ()
 
 setShortName ($shortName)
 
 setFullName ($fullName)
 
 setText ($text)
 
 setUrl ($url)
 
 setRisk ($risk)
 
 setIsCandidate ($isCandidate)
 
 setObligations ($obligations)
 
 addObligation ($obligation)
 
 setMergeRequest ($mergeRequest)
 

Static Public Member Functions

static parseFromArray ($inputLicense)
 

Public Attributes

const ALLOWED_KEYS
 

Private Attributes

 $id
 
 $shortName
 
 $fullName
 
 $text
 
 $url
 
 $obligations
 
 $risk
 
 $isCandidate
 
 $mergeRequest
 

Detailed Description

Definition at line 19 of file License.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\UI\Api\Models\License::__construct (   $id,
  $shortName = "",
  $fullName = "",
  $text = "",
  $url = "",
  $obligations = null,
  $risk = null,
  $isCandidate = false 
)

License constructor.

Parameters
integer$id
string$shortName
string$fullName
string$text
string$url
array$obligations
integer | null$risk
boolean$isCandidate

Definition at line 85 of file License.php.

Member Function Documentation

◆ addObligation()

Fossology\UI\Api\Models\License::addObligation (   $obligation)

Add obligation to license's associated obligations

Parameters
Obligation$obligationA single obligation to be added

Definition at line 315 of file License.php.

◆ getArray()

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

Get License element as associative array

Returns
array

Reimplemented in Fossology\UI\Api\Models\LicenseDecision.

Definition at line 120 of file License.php.

◆ getFullName()

Fossology\UI\Api\Models\License::getFullName ( )

Get the license's full name

Returns
string License's short name

Definition at line 162 of file License.php.

◆ getId()

Fossology\UI\Api\Models\License::getId ( )

Get the license ID

Returns
integer License's ID

Definition at line 141 of file License.php.

◆ getIsCandidate()

Fossology\UI\Api\Models\License::getIsCandidate ( )

Is the license a candidate?

Returns
boolean

Definition at line 207 of file License.php.

◆ getJSON()

Fossology\UI\Api\Models\License::getJSON ( )

JSON representation of the license

Returns
string

Reimplemented in Fossology\UI\Api\Models\LicenseDecision.

Definition at line 111 of file License.php.

◆ getMergeRequest()

Fossology\UI\Api\Models\License::getMergeRequest ( )

A new merge request to be made for the license?

Returns
boolean

Definition at line 229 of file License.php.

◆ getObligations()

Fossology\UI\Api\Models\License::getObligations ( )

Get the license's associated obligations

Returns
array|null License's associated obligations if set, null if not set

Definition at line 216 of file License.php.

◆ getRisk()

Fossology\UI\Api\Models\License::getRisk ( )

Get the license's risk level

Returns
int|null License's risk level if set, null if not set

Definition at line 198 of file License.php.

◆ getShortName()

Fossology\UI\Api\Models\License::getShortName ( )

Get the license's short name

Returns
string License's short name

Definition at line 150 of file License.php.

◆ getText()

Fossology\UI\Api\Models\License::getText ( )

Get the license's text

Returns
string License's text

Definition at line 174 of file License.php.

◆ getUrl()

Fossology\UI\Api\Models\License::getUrl ( )

Get the license's URL

Returns
string License's URL

Definition at line 186 of file License.php.

◆ parseFromArray()

static Fossology\UI\Api\Models\License::parseFromArray (   $inputLicense)
static

Parse a license from JSON input.

Parameters
array$inputLicenseObject sent by user
Returns
License

Definition at line 338 of file License.php.

◆ setFullName()

Fossology\UI\Api\Models\License::setFullName (   $fullName)

Set the license's full name

Parameters
string$fullNameLicense's full name

Definition at line 247 of file License.php.

◆ setIsCandidate()

Fossology\UI\Api\Models\License::setIsCandidate (   $isCandidate)

Set if license is candidate.

Parameters
boolean$isCandidate

Definition at line 289 of file License.php.

◆ setMergeRequest()

Fossology\UI\Api\Models\License::setMergeRequest (   $mergeRequest)

Set the merge request for new license

Parameters
boolean$mergeRequest

Definition at line 327 of file License.php.

◆ setObligations()

Fossology\UI\Api\Models\License::setObligations (   $obligations)

Set the license's associated obligations

Parameters
array$obligationsObligations to be added

Definition at line 298 of file License.php.

◆ setRisk()

Fossology\UI\Api\Models\License::setRisk (   $risk)

Set the license's risk level

Parameters
int | null$riskLicense's risk level or null

Definition at line 274 of file License.php.

◆ setShortName()

Fossology\UI\Api\Models\License::setShortName (   $shortName)

Set the license's short name

Parameters
string$shortNameLicense's short name

Definition at line 238 of file License.php.

◆ setText()

Fossology\UI\Api\Models\License::setText (   $text)

Set the license's text

Parameters
string$textLicense's text

Definition at line 256 of file License.php.

◆ setUrl()

Fossology\UI\Api\Models\License::setUrl (   $url)

Set the license's URL

Parameters
string$urlLicense's URL

Definition at line 265 of file License.php.

Member Data Documentation

◆ $fullName

string License::$fullName
private

Full name of the license

Definition at line 41 of file License.php.

◆ $id

integer License::$id
private

License id

Definition at line 31 of file License.php.

◆ $isCandidate

boolean License::$isCandidate
private

Is the license a candidate license?

Definition at line 66 of file License.php.

◆ $mergeRequest

boolean License::$mergeRequest
private

Create merge request for candidate license?

Definition at line 71 of file License.php.

◆ $obligations

array null License::$obligations
private

Obligations for the license

Definition at line 56 of file License.php.

◆ $shortName

string License::$shortName
private

Short name of the license

Definition at line 36 of file License.php.

◆ $text

string License::$text
private

The text of the license

Definition at line 46 of file License.php.

◆ $url

string License::$url
private

License URL

Definition at line 51 of file License.php.

◆ ALLOWED_KEYS

const Fossology\UI\Api\Models\License::ALLOWED_KEYS
Initial value:
= ['shortName', 'fullName', 'text', 'url', 'risk',
'isCandidate', 'mergeRequest']

Definition at line 25 of file License.php.


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