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

Public Member Functions

 __construct (DbManager $dbManager, UploadDao $uploadDao)
 
 getHighlights ($uploadTreeId, $tableName="copyright", $agentId=array(0), $typeToHighlightTypeMap=array('statement'=> Highlight::COPYRIGHT, 'email'=> Highlight::EMAIL, 'url'=> Highlight::URL, 'author'=> Highlight::AUTHOR))
 
 saveDecision ($tableName, $pfileId, $userId, $clearingType, $description, $textFinding, $comment, $decision_pk=-1)
 
 removeDecision ($tableName, $pfileId, $decisionId)
 
 undoDecision ($tableName, $pfileId, $decisionId)
 
 getAllEventEntriesForUpload ($uploadFk, $agentId, $scope=1)
 
 getScannerEntries ($tableName, $uploadTreeTableName, $uploadId, $type, $extrawhere, $enabled='true')
 
 getEditedEntries ($tableName, $uploadTreeTableName, $uploadId, $decisionType, $extrawhere="")
 
 getAllEntriesReport ($tableName, $uploadId, $uploadTreeTableName, $type=null, $onlyCleared=false, $decisionType=null, $extrawhere=null, $groupId=null)
 
 getAllEntries ($tableName, $uploadId, $uploadTreeTableName, $type=null, $onlyCleared=false, $decisionType=null, $extrawhere=null)
 
 getDecisions ($tableName, $pfileId)
 
 getDecisionsFromHash ($tableName, $hash, $upload=null, $uploadtreetable=null)
 Get all the decisions based on hash. More...
 
 updateTable ($item, $hash, $content, $userId, $cpTable, $action='', $scope=1)
 
 getTableName ($type)
 Get table name based on statement type. More...
 
 getTotalCopyrights ($upload_pk, $item, $uploadTreeTableName, $agentId, $type, $activated=true)
 Get total number of copyrights for a uploadtree. More...
 
 getUserCopyrights ($upload_pk, $item, $uploadTreeTableName, $type, $activated=true, $offset=null, $limit=null)
 get user copyright findings for a uploadtree More...
 

Private Member Functions

 getAgentName ($table)
 Get agent name based on table name. More...
 

Private Attributes

 $dbManager
 
 $uploadDao
 
 $logger
 

Detailed Description

Definition at line 18 of file CopyrightDao.php.

Member Function Documentation

◆ getAgentName()

Fossology\Lib\Dao\CopyrightDao::getAgentName (   $table)
private

Get agent name based on table name.

  • copyright => copyright
  • ecc => ecc
  • keyword => keyword
  • ipra => ipra
  • scancode_copyright, scancode_author => scancode
  • others => copyright
    Parameters
    string$tableTable name
    Returns
    string Agent name

Definition at line 548 of file CopyrightDao.php.

◆ getAllEntriesReport()

Fossology\Lib\Dao\CopyrightDao::getAllEntriesReport (   $tableName,
  $uploadId,
  $uploadTreeTableName,
  $type = null,
  $onlyCleared = false,
  $decisionType = null,
  $extrawhere = null,
  $groupId = null 
)
Parameters
$tableName
$uploadId
$uploadTreeTableName
$type
bool$onlyCleared
$decisionType
$extrawhere
$groupId
Returns
array

Definition at line 298 of file CopyrightDao.php.

◆ getAllEventEntriesForUpload()

Fossology\Lib\Dao\CopyrightDao::getAllEventEntriesForUpload (   $uploadFk,
  $agentId,
  $scope = 1 
)
Parameters
$uploadFk
$agentId
int$scope
Returns
array $rows

Definition at line 168 of file CopyrightDao.php.

◆ getDecisions()

Fossology\Lib\Dao\CopyrightDao::getDecisions (   $tableName,
  $pfileId 
)
Parameters
$tableName
$pfileId
Returns
array

Definition at line 394 of file CopyrightDao.php.

◆ getDecisionsFromHash()

Fossology\Lib\Dao\CopyrightDao::getDecisionsFromHash (   $tableName,
  $hash,
  $upload = null,
  $uploadtreetable = null 
)

Get all the decisions based on hash.

Get all the decisions which matches the given hash. If the upload is null, get decision from all uploads, otherwise get decisions only for the given upload.

Parameters
string$tableNameDecision table name
string$hashHash of the decision
int$uploadUpload id
string$uploadtreetableName of the upload tree table
Returns
array

Definition at line 417 of file CopyrightDao.php.

◆ getEditedEntries()

Fossology\Lib\Dao\CopyrightDao::getEditedEntries (   $tableName,
  $uploadTreeTableName,
  $uploadId,
  $decisionType,
  $extrawhere = "" 
)
Parameters
string$tableName
string$uploadTreeTableName
integer$uploadId
integer$decisionType
string$extrawhere
Returns
array $result

Definition at line 246 of file CopyrightDao.php.

◆ getHighlights()

Fossology\Lib\Dao\CopyrightDao::getHighlights (   $uploadTreeId,
  $tableName = "copyright",
  $agentId = array(0),
  $typeToHighlightTypeMap = array(                                          'statement' => Highlight::COPYRIGHT,                                          'email' => Highlight::EMAIL,                                          'url' => Highlight::URL,                                          'author' => Highlight::AUTHOR) 
)
Parameters
int$uploadTreeId
string$tableName
array$agentId
array$typeToHighlightTypeMap
Exceptions

Definition at line 42 of file CopyrightDao.php.

◆ getScannerEntries()

Fossology\Lib\Dao\CopyrightDao::getScannerEntries (   $tableName,
  $uploadTreeTableName,
  $uploadId,
  $type,
  $extrawhere,
  $enabled = 'true' 
)
Parameters
$tableName
$uploadTreeTableName
$uploadId
$type
$extrawhere
$enabled
Returns
array $result

Definition at line 191 of file CopyrightDao.php.

◆ getTableName()

Fossology\Lib\Dao\CopyrightDao::getTableName (   $type)

Get table name based on statement type.

  • statement => copyright
  • ecc => ecc
  • others => author
  • scancode_statement => scancode copyright
  • scancode_email => scancode email
  • scancode_author => scancode author
  • scancode_url => scancode url
    Parameters
    string$typeResult type
    Returns
    string Table name

Definition at line 571 of file CopyrightDao.php.

◆ getTotalCopyrights()

Fossology\Lib\Dao\CopyrightDao::getTotalCopyrights (   $upload_pk,
  $item,
  $uploadTreeTableName,
  $agentId,
  $type,
  $activated = true 
)

Get total number of copyrights for a uploadtree.

Parameters
int$upload_pkUpload id to get results from
int$itemUpload tree id of the item
string$uploadTreeTableNameUpload tree table to use
string$agentIdId of the agent who loaded the results
string$typeType of the statement (statement, url, email, author or ecc)
boolean$activatedTrue to get activated copyrights, else false
Returns
integer Number of total Records

Definition at line 614 of file CopyrightDao.php.

◆ getUserCopyrights()

Fossology\Lib\Dao\CopyrightDao::getUserCopyrights (   $upload_pk,
  $item,
  $uploadTreeTableName,
  $type,
  $activated = true,
  $offset = null,
  $limit = null 
)

get user copyright findings for a uploadtree

Parameters
int$upload_pkUpload id to get results from
int$itemUpload tree id of the item
string$uploadTreeTableNameUpload tree table to use
string$typeType of the statement (statement, url, email, author or ecc)
boolean$activatedTrue to get activated copyrights, else false
Returns
array[][] Array of table records, total records

Definition at line 657 of file CopyrightDao.php.

◆ saveDecision()

Fossology\Lib\Dao\CopyrightDao::saveDecision (   $tableName,
  $pfileId,
  $userId,
  $clearingType,
  $description,
  $textFinding,
  $comment,
  $decision_pk = -1 
)
Parameters
$tableName
$pfileId
$userId
$clearingType
$description
$textFinding
$comment
int$decision_pk
Returns
int decision_pk of decision

Definition at line 103 of file CopyrightDao.php.

◆ updateTable()

Fossology\Lib\Dao\CopyrightDao::updateTable (   $item,
  $hash,
  $content,
  $userId,
  $cpTable,
  $action = '',
  $scope = 1 
)
Parameters
ItemTreeBounds$item
string$hash
string$content
int$userId
string$cpTable

Definition at line 448 of file CopyrightDao.php.


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