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

Public Member Functions

 __construct (DbManager $dbManager)
 
 getAgentFileLicenseMatches (ItemTreeBounds $itemTreeBounds, $usageId=LicenseMap::TRIVIAL)
 get all the licenses for a single file or uploadtree More...
 
 getBulkFileLicenseMatches (ItemTreeBounds $itemTreeBounds)
 get all the tried bulk recognitions for a single file or uploadtree (currently unused) More...
 
 getLicenseRefs ($search=null, $orderAscending=true)
 
 getConclusionLicenseRefs ($groupId, $search=null, $orderAscending=true, $exclude=array())
 
 getLicenseArray ($groupId=null)
 
 getLicenseIdPerPfileForAgentId (ItemTreeBounds $itemTreeBounds, $selectedAgentId, $includeSubfolders=true, $nameRange=array())
 
 getLicensesPerFileNameForAgentId (ItemTreeBounds $itemTreeBounds, $selectedAgentIds=null, $includeSubfolders=true, $excluding='', $ignore=false, &$clearingDecisionsForLicList=array(), $includeTreeId=false)
 
 getLicenseHistogram (ItemTreeBounds $itemTreeBounds, $agentId=null)
 
 getLicenseShortnamesContained (ItemTreeBounds $itemTreeBounds, $latestSuccessfulAgentIds=null, $filterLicenses=array('VOID'))
 
 getLicenseById ($licenseId, $groupId=null)
 
 getLicenseByShortName ($licenseShortname, $groupId=null)
 
 getLicenseBySpdxId ($licenseSpdxId, $groupId=null)
 
 insertBulkLicense ($userId, $groupId, $uploadTreeId, $licenseRemovals, $refText, $ignoreIrrelevant=true, $delimiters=null, $scanFindingsOnly=false)
 
 isNewLicense ($newShortname, $groupId)
 
 insertLicense ($shortname, $refText, $spdxId=null)
 
 insertUploadLicense ($newShortname, $refText, $groupId, $userId)
 
 getLicenseCount ()
 
 updateCandidate ($rf_pk, $shortname, $fullname, $rfText, $url, $rfNotes, $lastmodified, $userIdmodified, $readyformerge, $riskLvl, $spdxId=null)
 
 getLicenseParentById ($licenseId, $groupId=null)
 
 getLicenseObligations ($licenseLists, $candidate=false)
 
 getLicenseType ($licenseId)
 

Public Attributes

const NO_LICENSE_FOUND = 'No_license_found'
 
const VOID_LICENSE = 'Void'
 

Private Member Functions

 updateStackState (&$pathStack, &$rgtStack, &$lastLft, $row)
 
 addToLicensesPerFileName (&$licensesPerFileName, $path, $row, $ignore, &$clearingDecisionsForLicList=array(), $includeTreeId=false)
 
 getLicenseByCondition ($condition, $param, $groupId=null)
 

Private Attributes

 $dbManager
 
 $logger
 
 $candidatePrefix = '*'
 

Detailed Description

Definition at line 22 of file LicenseDao.php.

Member Function Documentation

◆ getAgentFileLicenseMatches()

Fossology\Lib\Dao\LicenseDao::getAgentFileLicenseMatches ( ItemTreeBounds  $itemTreeBounds,
  $usageId = LicenseMap::TRIVIAL 
)

get all the licenses for a single file or uploadtree

Parameters
ItemTreeBounds$itemTreeBounds
int
Returns
LicenseMatch[]

Definition at line 47 of file LicenseDao.php.

◆ getBulkFileLicenseMatches()

Fossology\Lib\Dao\LicenseDao::getBulkFileLicenseMatches ( ItemTreeBounds  $itemTreeBounds)

get all the tried bulk recognitions for a single file or uploadtree (currently unused)

Parameters
ItemTreeBounds$itemTreeBounds
Returns
LicenseMatch[]

Definition at line 97 of file LicenseDao.php.

◆ getConclusionLicenseRefs()

Fossology\Lib\Dao\LicenseDao::getConclusionLicenseRefs (   $groupId,
  $search = null,
  $orderAscending = true,
  $exclude = array() 
)
Returns
LicenseRef[]

Definition at line 174 of file LicenseDao.php.

◆ getLicenseArray()

Fossology\Lib\Dao\LicenseDao::getLicenseArray (   $groupId = null)
Returns
array

Definition at line 212 of file LicenseDao.php.

◆ getLicenseByCondition()

Fossology\Lib\Dao\LicenseDao::getLicenseByCondition (   $condition,
  $param,
  $groupId = null 
)
private
Parameters
string$condition
array$param
$groupId
Returns
License|null

Definition at line 504 of file LicenseDao.php.

◆ getLicenseById()

Fossology\Lib\Dao\LicenseDao::getLicenseById (   $licenseId,
  $groupId = null 
)
Parameters
string$licenseId
int | null$groupId
Returns
License|null

Definition at line 540 of file LicenseDao.php.

◆ getLicenseByShortName()

Fossology\Lib\Dao\LicenseDao::getLicenseByShortName (   $licenseShortname,
  $groupId = null 
)
Parameters
string$licenseShortname
int | null$groupId
Returns
License|null

Definition at line 550 of file LicenseDao.php.

◆ getLicenseBySpdxId()

Fossology\Lib\Dao\LicenseDao::getLicenseBySpdxId (   $licenseSpdxId,
  $groupId = null 
)
Parameters
string$licenseSpdxIdLicense SPDX ID
int$groupIdGroup ID
Returns
License|null License, if found, null otherwise.

Definition at line 560 of file LicenseDao.php.

◆ getLicenseCount()

Fossology\Lib\Dao\LicenseDao::getLicenseCount ( )
Parameters
array("Licenseby Nomos.")
Returns
int count of license_ref

Definition at line 660 of file LicenseDao.php.

◆ getLicenseHistogram()

Fossology\Lib\Dao\LicenseDao::getLicenseHistogram ( ItemTreeBounds  $itemTreeBounds,
  $agentId = null 
)
Parameters
ItemTreeBounds$itemTreeBounds
null | int | int[]$agentId
Returns
array

Definition at line 421 of file LicenseDao.php.

◆ getLicenseIdPerPfileForAgentId()

Fossology\Lib\Dao\LicenseDao::getLicenseIdPerPfileForAgentId ( ItemTreeBounds  $itemTreeBounds,
  $selectedAgentId,
  $includeSubfolders = true,
  $nameRange = array() 
)
Parameters
ItemTreeBounds$itemTreeBounds
int$selectedAgentId
bool$includeSubfolders
array$nameRange
Returns
array

Definition at line 239 of file LicenseDao.php.

◆ getLicenseObligations()

Fossology\Lib\Dao\LicenseDao::getLicenseObligations (   $licenseLists,
  $candidate = false 
)

Get obligations associated to the list of licenses sent.

Parameters
array$licenseListsList of licenses
boolean$candidateIs candidate obligation map?
Returns
array

Definition at line 714 of file LicenseDao.php.

◆ getLicenseParentById()

Fossology\Lib\Dao\LicenseDao::getLicenseParentById (   $licenseId,
  $groupId = null 
)
Parameters
int$licenseId
int$groupId

Definition at line 702 of file LicenseDao.php.

◆ getLicenseRefs()

Fossology\Lib\Dao\LicenseDao::getLicenseRefs (   $search = null,
  $orderAscending = true 
)
Returns
LicenseRef[]

Definition at line 142 of file LicenseDao.php.

◆ getLicensesPerFileNameForAgentId()

Fossology\Lib\Dao\LicenseDao::getLicensesPerFileNameForAgentId ( ItemTreeBounds  $itemTreeBounds,
  $selectedAgentIds = null,
  $includeSubfolders = true,
  $excluding = '',
  $ignore = false,
$clearingDecisionsForLicList = array(),
  $includeTreeId = false 
)
Parameters
ItemTreeBounds$itemTreeBounds
int[]$selectedAgentIds
bool$includeSubfolders
String$excluding
bool$ignoreignore files without license
bool$includeTreeIdInclude tree id in the response array?
Returns
array

Definition at line 298 of file LicenseDao.php.

◆ getLicenseType()

Fossology\Lib\Dao\LicenseDao::getLicenseType (   $licenseId)

Get type of license.

Parameters
int$licenseIdLicense to get type for
Returns
string|null License Type if found, null otherwise.

Definition at line 755 of file LicenseDao.php.

◆ insertBulkLicense()

Fossology\Lib\Dao\LicenseDao::insertBulkLicense (   $userId,
  $groupId,
  $uploadTreeId,
  $licenseRemovals,
  $refText,
  $ignoreIrrelevant = true,
  $delimiters = null,
  $scanFindingsOnly = false 
)
Parameters
int$userId
int$groupId
int$uploadTreeId
bool[]$licenseRemovals
string$refText
bool$ignoreIrrelevantIgnore irrelevant files while scanning
bool$scanOnlyFindingsscan the files with license findings only
string$delimitersDelimiters for bulk scan, null or "DEFAULT" for default values
Returns
int lrp_pk on success or -1 on fail

Definition at line 577 of file LicenseDao.php.

◆ insertLicense()

Fossology\Lib\Dao\LicenseDao::insertLicense (   $shortname,
  $refText,
  $spdxId = null 
)
Parameters
string$shortname
string$refText
string$spdxId
Returns
mixed

Definition at line 631 of file LicenseDao.php.

◆ insertUploadLicense()

Fossology\Lib\Dao\LicenseDao::insertUploadLicense (   $newShortname,
  $refText,
  $groupId,
  $userId 
)
Parameters
string$newShortname
string$refText
Returns
int Id of license candidate

Definition at line 647 of file LicenseDao.php.

◆ isNewLicense()

Fossology\Lib\Dao\LicenseDao::isNewLicense (   $newShortname,
  $groupId 
)
Parameters
string$newShortname
int$groupId
Returns
bool

Definition at line 617 of file LicenseDao.php.

◆ updateCandidate()

Fossology\Lib\Dao\LicenseDao::updateCandidate (   $rf_pk,
  $shortname,
  $fullname,
  $rfText,
  $url,
  $rfNotes,
  $lastmodified,
  $userIdmodified,
  $readyformerge,
  $riskLvl,
  $spdxId = null 
)
Parameters
int$rf_pk
string$shortname
string$fullname
string$rfText,$rfNotes
string$readyformerge
int$riskLvl
string$spdxId

Definition at line 675 of file LicenseDao.php.


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