FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Dao\CompatibilityDao Class Reference
Collaboration diagram for Fossology\Lib\Dao\CompatibilityDao:
Collaboration graph

Public Member Functions

 __construct (DbManager $dbManager, Logger $logger, LicenseDao $licenseDao, AgentDao $agentDao)
 
 getAllRules ()
 Get all the existing rules present in the database. More...
 
 insertRule ($firstName, $secondName, $firstType, $secondType, $comment, $result)
 Insert new rule in the database. More...
 
 updateRuleFromArray ($ruleArray)
 Update the existing rules. More...
 
 deleteRule ($rulePk)
 Delete a license compatibility rule. More...
 
 getDefaultCompatibility ()
 

Private Member Functions

 isRuleIdValid ($rulePk)
 Check if rule ID exists in DB. More...
 

Private Attributes

 $dbManager
 
 $logger
 
 $licenseDao
 
 $agentDao
 
 $defaultCompatibility
 
 $agentName
 

Detailed Description

Definition at line 21 of file CompatibilityDao.php.

Member Function Documentation

◆ deleteRule()

Fossology\Lib\Dao\CompatibilityDao::deleteRule (   $rulePk)

Delete a license compatibility rule.

Parameters
int$rulePkID of the rule to be deleted
Returns
boolean

Definition at line 236 of file CompatibilityDao.php.

◆ getAllRules()

Fossology\Lib\Dao\CompatibilityDao::getAllRules ( )

Get all the existing rules present in the database.

Returns
array

Definition at line 100 of file CompatibilityDao.php.

◆ getDefaultCompatibility()

Fossology\Lib\Dao\CompatibilityDao::getDefaultCompatibility ( )

Get the default compatibility from the rules table.

Returns
bool

Definition at line 260 of file CompatibilityDao.php.

◆ insertRule()

Fossology\Lib\Dao\CompatibilityDao::insertRule (   $firstName,
  $secondName,
  $firstType,
  $secondType,
  $comment,
  $result 
)

Insert new rule in the database.

Parameters
string$firstNameFirst license
string$secondNameSecond license
string$firstTypeFirst license type
string$secondTypeSecond license type
string$commentComment on the rule
string$resultCompatibility result of the two licenses
Returns
int -1: rule not inserted, -2 error at insertion otherwise rule ID

Definition at line 118 of file CompatibilityDao.php.

◆ isRuleIdValid()

Fossology\Lib\Dao\CompatibilityDao::isRuleIdValid (   $rulePk)
private

Check if rule ID exists in DB.

Parameters
int$rulePkRule ID to check.
Exceptions

Definition at line 216 of file CompatibilityDao.php.

◆ updateRuleFromArray()

Fossology\Lib\Dao\CompatibilityDao::updateRuleFromArray (   $ruleArray)

Update the existing rules.

Parameters
array$ruleArrayContains the id of the licenses
Exceptions

Definition at line 156 of file CompatibilityDao.php.


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