FOSSology  3.2.0rc1
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 license id from the shortname. 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)
 

Private Attributes

 $dbManager
 

Detailed Description

Wrapper class for obligation map.

Definition at line 27 of file ObligationMap.php.

Constructor & Destructor Documentation

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

Constructor

Parameters
DbManager$dbManagerDB manager to use

Definition at line 38 of file ObligationMap.php.

Member Function Documentation

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 255 of file ObligationMap.php.

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 176 of file ObligationMap.php.

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

Get the license id from the shortname.

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

Definition at line 48 of file ObligationMap.php.

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 77 of file ObligationMap.php.

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 119 of file ObligationMap.php.

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

Get all obligations from DB.

Returns
array

Definition at line 230 of file ObligationMap.php.

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 101 of file ObligationMap.php.

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 241 of file ObligationMap.php.

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 147 of file ObligationMap.php.

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 273 of file ObligationMap.php.

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 199 of file ObligationMap.php.

Member Data Documentation

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

DB manager object

Definition at line 32 of file ObligationMap.php.


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