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

Wrapper class for obligation map. More...

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

Public Member Functions

 __construct (DbManager $dbManager)
 
 getAvailableShortnames ($candidate=false)
 Get the list of license shortnames. More...
 
 getIdFromShortname ($shortname, $candidate=false)
 Get the license ids from the shortname. More...
 
 getShortnameFromId ($rfId, $candidate=false)
 Get the shortname of the license by Id. More...
 
 getLicenseList ($obId, $candidate=false)
 Get the list of licenses associated with the obligation. More...
 
 isLicenseAssociated ($obId, $licId, $candidate=false)
 Check if the obligation is already associated with the license. More...
 
 associateLicenseWithObligation ($obId, $licId, $candidate=false)
 Associate a license with an obligation. More...
 
 unassociateLicenseFromObligation ($obId, $licId=0, $candidate=false)
 Unassociate a license from an obligation. More...
 
 getObligations ()
 Get all obligations from DB. More...
 
 getTopicNameFromId ($ob_pk)
 Get the obligation topic from the obligation id. More...
 
 associateLicenseFromLicenseList ($obligationId, $licenses, $candidate=false)
 
 unassociateLicenseFromLicenseList ($obligationId, $licenses, $candidate=false)
 
 getObligationById ($ob_pk)
 
 deleteObligation ($ob_pk)
 

Private Attributes

 $dbManager
 

Detailed Description

Wrapper class for obligation map.

Definition at line 16 of file ObligationMap.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\Lib\BusinessRules\ObligationMap::__construct ( DbManager  $dbManager)

Constructor

Parameters
DbManager$dbManagerDB manager to use

Definition at line 27 of file ObligationMap.php.

Member Function Documentation

◆ associateLicenseFromLicenseList()

Fossology\Lib\BusinessRules\ObligationMap::associateLicenseFromLicenseList (   $obligationId,
  $licenses,
  $candidate = false 
)

Associate a list of license IDs with given obligation.

Parameters
integer$obligationIdObligation to be associated
array$licensesArray of licenses to be associated
boolean$candidateIs a candidate association?
Returns
boolean True if new association is made, false otherwise.

Definition at line 250 of file ObligationMap.php.

◆ associateLicenseWithObligation()

Fossology\Lib\BusinessRules\ObligationMap::associateLicenseWithObligation (   $obId,
  $licId,
  $candidate = false 
)

Associate a license with an obligation.

Parameters
int$obIdObligation id
int$licIdLicense id
bool$candidateIs a candidate obligation?

Definition at line 171 of file ObligationMap.php.

◆ deleteObligation()

Fossology\Lib\BusinessRules\ObligationMap::deleteObligation (   $ob_pk)

Delete obligation and unassociate all licenses.

Parameters
int$ob_pkObligation ID
Returns
void

Definition at line 292 of file ObligationMap.php.

◆ getAvailableShortnames()

Fossology\Lib\BusinessRules\ObligationMap::getAvailableShortnames (   $candidate = false)

Get the list of license shortnames.

If candidate license, return list of all licenses. If not-candidate license, return list of licenses which have conclusion on self.

Parameters
bool$candidateIs a candidate license
Returns
string[] Array of license shortnames

Definition at line 41 of file ObligationMap.php.

◆ getIdFromShortname()

Fossology\Lib\BusinessRules\ObligationMap::getIdFromShortname (   $shortname,
  $candidate = false 
)

Get the license ids from the shortname.

Parameters
string$shortnameShort name of the license
bool$candidateIs a candidate license?
Returns
int[] License ids

Definition at line 72 of file ObligationMap.php.

◆ getLicenseList()

Fossology\Lib\BusinessRules\ObligationMap::getLicenseList (   $obId,
  $candidate = false 
)

Get the list of licenses associated with the obligation.

Parameters
int$obIdObligation id
bool$candidateIs a candidate obligation?
Returns
string List of license shortname delimited by ‘’;'`

Definition at line 114 of file ObligationMap.php.

◆ getObligationById()

Fossology\Lib\BusinessRules\ObligationMap::getObligationById (   $ob_pk)

Get obligation by id

Parameters
int$ob_pkObligation ID
Returns
array Obligation from DB

Definition at line 280 of file ObligationMap.php.

◆ getObligations()

Fossology\Lib\BusinessRules\ObligationMap::getObligations ( )

Get all obligations from DB.

Returns
array

Definition at line 225 of file ObligationMap.php.

◆ getShortnameFromId()

Fossology\Lib\BusinessRules\ObligationMap::getShortnameFromId (   $rfId,
  $candidate = false 
)

Get the shortname of the license by Id.

Parameters
int$rfIdID of the license
bool$candidateIs a candidate license?
Returns
string License shortname

Definition at line 96 of file ObligationMap.php.

◆ getTopicNameFromId()

Fossology\Lib\BusinessRules\ObligationMap::getTopicNameFromId (   $ob_pk)

Get the obligation topic from the obligation id.

Parameters
int$ob_pkObligation id
Returns
string Obligation topic

Definition at line 236 of file ObligationMap.php.

◆ isLicenseAssociated()

Fossology\Lib\BusinessRules\ObligationMap::isLicenseAssociated (   $obId,
  $licId,
  $candidate = false 
)

Check if the obligation is already associated with the license.

Parameters
int$obIdObligation id
int$licIdLicense id
bool$candidateIs a candidate obligation?
Returns
bool True if license is already mapped, false otherwise

Definition at line 142 of file ObligationMap.php.

◆ unassociateLicenseFromLicenseList()

Fossology\Lib\BusinessRules\ObligationMap::unassociateLicenseFromLicenseList (   $obligationId,
  $licenses,
  $candidate = false 
)

Unassociate a list of license IDs with given obligation.

Parameters
integer$obligationIdObligation to be unassociated
array$licensesArray of licenses to be unassociated
boolean$candidateIs a candidate association?

Definition at line 268 of file ObligationMap.php.

◆ unassociateLicenseFromObligation()

Fossology\Lib\BusinessRules\ObligationMap::unassociateLicenseFromObligation (   $obId,
  $licId = 0,
  $candidate = false 
)

Unassociate a license from an obligation.

Parameters
int$obIdObligation id
int$licIdLicense id
bool$candidateIs a candidate obligation?

Definition at line 194 of file ObligationMap.php.

Member Data Documentation

◆ $dbManager

DbManager Fossology\Lib\BusinessRules\ObligationMap::$dbManager
private

DB manager object

Definition at line 21 of file ObligationMap.php.


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