FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\BusinessRules\LicenseMap Class Reference

Wrapper class for license map. More...

Collaboration diagram for Fossology\Lib\BusinessRules\LicenseMap:
Collaboration graph

Public Member Functions

 __construct (DbManager $dbManager, $groupId, $usageId=null, $full=false)
 
 getProjectedId ($licenseId)
 For a given license id, get the projected id. More...
 
 getProjectedShortname ($licenseId, $defaultName=null)
 For a given license id, get the projected shortname. More...
 
 getProjectedSpdxId ($licenseId, $defaultID=null)
 For a given license id, get the projected SPDX ID (or shortname if ID does not exist). More...
 
 getProjectedName ($licenseId, $defaultName=null)
 For a given license id, get the projected fullname. If empty, get the shortname instead. More...
 
 getUsage ()
 
 getGroupId ()
 
 getTopLevelLicenseRefs ()
 
 getObligationsForLicenseRef ($license_ref, $candidate=false)
 Get all Obligations attached with given license ref. More...
 

Static Public Member Functions

static getMappedLicenseRefView ($usageExpr=' $1')
 Query to get license map view along with license ref. More...
 

Public Attributes

const CONCLUSION = 1
 
const TRIVIAL = 2
 
const FAMILY = 3
 
const REPORT = 4
 
const MAX_CHAR_LIMIT = "32767"
 
const TEXT_MAX_CHAR_LIMIT = "The maximum number of characters per cell in a CSV file(32,767) exceeded, Please edit this license text in UI"
 

Private Attributes

 $dbManager
 
 $usageId
 
 $groupId
 
 $map = array()
 

Detailed Description

Wrapper class for license map.

Definition at line 18 of file LicenseMap.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\Lib\BusinessRules\LicenseMap::__construct ( DbManager  $dbManager,
  $groupId,
  $usageId = null,
  $full = false 
)

Constructor

Parameters
DbManager$dbManager
int$groupId
int$usageId
bool$full

Definition at line 43 of file LicenseMap.php.

Member Function Documentation

◆ getGroupId()

Fossology\Lib\BusinessRules\LicenseMap::getGroupId ( )

Get the group id of the map.

Returns
number

Definition at line 159 of file LicenseMap.php.

◆ getMappedLicenseRefView()

static Fossology\Lib\BusinessRules\LicenseMap::getMappedLicenseRefView (   $usageExpr = '$1')
static

Query to get license map view along with license ref.

Parameters
string$usageExprPosition of usage id in parameter array

Definition at line 191 of file LicenseMap.php.

◆ getObligationsForLicenseRef()

Fossology\Lib\BusinessRules\LicenseMap::getObligationsForLicenseRef (   $license_ref,
  $candidate = false 
)

Get all Obligations attached with given license ref.

Parameters
int$license_refID of license / candidate license
bool$candidateIs the license candidate?
Returns
int[] Array of obligation ids

Definition at line 204 of file LicenseMap.php.

◆ getProjectedId()

Fossology\Lib\BusinessRules\LicenseMap::getProjectedId (   $licenseId)

For a given license id, get the projected id.

Parameters
int$licenseIdLicense id to be queried
Returns
int Projected license id

Definition at line 87 of file LicenseMap.php.

◆ getProjectedName()

Fossology\Lib\BusinessRules\LicenseMap::getProjectedName (   $licenseId,
  $defaultName = null 
)

For a given license id, get the projected fullname. If empty, get the shortname instead.

Parameters
int$licenseIdLicense ID
string$defaultNameDefault name if license not in map
Returns
mixed|string|null Projected fullname or default name

Definition at line 134 of file LicenseMap.php.

◆ getProjectedShortname()

Fossology\Lib\BusinessRules\LicenseMap::getProjectedShortname (   $licenseId,
  $defaultName = null 
)

For a given license id, get the projected shortname.

If the license id is not found in the map, then default name is returned.

Parameters
int$licenseIdLicense id to be queried
string$defaultNameDefault name to return if license not found in map
Returns
string|null Projected shortname or default name

Definition at line 103 of file LicenseMap.php.

◆ getProjectedSpdxId()

Fossology\Lib\BusinessRules\LicenseMap::getProjectedSpdxId (   $licenseId,
  $defaultID = null 
)

For a given license id, get the projected SPDX ID (or shortname if ID does not exist).

Parameters
int$licenseIdLicense id to be queried
string$defaultIDDefault ID to return if license not found in map
Returns
string|null Projected SPDX ID or default name

Definition at line 118 of file LicenseMap.php.

◆ getTopLevelLicenseRefs()

Fossology\Lib\BusinessRules\LicenseMap::getTopLevelLicenseRefs ( )

Get the top level license refs from the license map.

Returns
Fossology::Lib::Data::LicenseRef[]

Definition at line 168 of file LicenseMap.php.

◆ getUsage()

Fossology\Lib\BusinessRules\LicenseMap::getUsage ( )

Get the Usage of the map.

Returns
number

Definition at line 150 of file LicenseMap.php.


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