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 ($limit=10, $offset=0, $searchTerm='')
 Get all the existing license compatibility rules from the database. More...
 
 getTotalRulesCount ($searchTerm='')
 Get the total count of license compatibility rules. More...
 
 insertEmptyRule ()
 Insert a new empty rule 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 288 of file CompatibilityDao.php.

◆ getAllRules()

Fossology\Lib\Dao\CompatibilityDao::getAllRules (   $limit = 10,
  $offset = 0,
  $searchTerm = '' 
)

Get all the existing license compatibility rules from the database.

Parameters
int$limitThe maximum number of rules to retrieve (default is 10)
int$offsetThe number of rules to skip (default is 0)
string$searchTermThe search term to filter rules by (default is an empty string)
Returns
array An array of license compatibility rules

Definition at line 103 of file CompatibilityDao.php.

◆ getDefaultCompatibility()

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

Get the default compatibility from the rules table.

Returns
bool

Definition at line 312 of file CompatibilityDao.php.

◆ getTotalRulesCount()

Fossology\Lib\Dao\CompatibilityDao::getTotalRulesCount (   $searchTerm = '')

Get the total count of license compatibility rules.

Parameters
string$searchTermThe search term to filter rules by (default is an empty string)
Returns
int The total count of rules that match the search term

Definition at line 120 of file CompatibilityDao.php.

◆ insertEmptyRule()

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

Insert a new empty rule in the database.

Returns
int

Definition at line 134 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 170 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 268 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 208 of file CompatibilityDao.php.


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