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

Public Member Functions

 __construct (DbManager $dbManager)
 
 getAllAcknowledgements ($skipNotSet=false)
 
 updateAcknowledgement ($acknowledgementPk, $newName, $newAcknowledgement)
 
 insertAcknowledgement ($name, $acknowledgement)
 
 updateAcknowledgementFromArray ($acknowledgementArray)
 Update the acknowledgements based only on the values provided. More...
 
 getAcknowledgement ($acknowledgementPk)
 
 toggleAcknowledgement ($acknowledgementPk)
 

Private Member Functions

 isAcknowledgementIdValid ($acknowledgementPk)
 

Private Attributes

 $dbManager
 

Detailed Description

DAO layer for license_std_acknowledgement table.

Definition at line 22 of file LicenseAcknowledgementDao.php.

Member Function Documentation

◆ getAcknowledgement()

Fossology\Lib\Dao\LicenseAcknowledgementDao::getAcknowledgement (   $acknowledgementPk)

Get the acknowledgement for the given acknowledgement id

Parameters
int$acknowledgementPkThe acknowledgement id
Returns
string|null Acknowledgement from the DB (if set, null otherwise)

Definition at line 177 of file LicenseAcknowledgementDao.php.

◆ getAllAcknowledgements()

Fossology\Lib\Dao\LicenseAcknowledgementDao::getAllAcknowledgements (   $skipNotSet = false)

Get all the acknowledgements and their name stored in the DB, sorted by their ID in ascending order.

Parameters
boolean$skipNotSetSkip the entries where the name is not changed or are disabled.
Returns
array All acknowledgements from the DB

Definition at line 40 of file LicenseAcknowledgementDao.php.

◆ insertAcknowledgement()

Fossology\Lib\Dao\LicenseAcknowledgementDao::insertAcknowledgement (   $name,
  $acknowledgement 
)

Insert a new acknowledgement

Parameters
string$nameName of the acknowledgement
string$acknowledgementAcknowledgement
Returns
int New acknowledgement ID if inserted successfully, -1 otherwise or -2 in case of exception.

Definition at line 87 of file LicenseAcknowledgementDao.php.

◆ isAcknowledgementIdValid()

Fossology\Lib\Dao\LicenseAcknowledgementDao::isAcknowledgementIdValid (   $acknowledgementPk)
private

Check if the given acknowledgement id is an integer and exists in DB.

Parameters
int$acknowledgementPkAcknowledgement id to check for
Exceptions

Definition at line 221 of file LicenseAcknowledgementDao.php.

◆ toggleAcknowledgement()

Fossology\Lib\Dao\LicenseAcknowledgementDao::toggleAcknowledgement (   $acknowledgementPk)

Toggle acknowledgement status.

Parameters
int$acknowledgementPkThe acknowledgement id
Returns
boolean True if the acknowledgement is toggled, false otherwise.

Definition at line 197 of file LicenseAcknowledgementDao.php.

◆ updateAcknowledgement()

Fossology\Lib\Dao\LicenseAcknowledgementDao::updateAcknowledgement (   $acknowledgementPk,
  $newName,
  $newAcknowledgement 
)

Update single acknowledgement

Parameters
int$acknowledgementPkThe acknowledgement id
string$newNameNew name of the acknowledgement
string$newAcknowledgementUpdated acknowledgement
Returns
boolean True if the acknowledgements are updated, false otherwise.

Definition at line 59 of file LicenseAcknowledgementDao.php.

◆ updateAcknowledgementFromArray()

Fossology\Lib\Dao\LicenseAcknowledgementDao::updateAcknowledgementFromArray (   $acknowledgementArray)

Update the acknowledgements based only on the values provided.

Takes an array as input and update only the fields passed.

Parameters
array$acknowledgementArrayAssociative array with acknowledgement id as the index, name and acknowledgement as child index with corresponding values.
Returns
int Count of values updated
Exceptions

Definition at line 131 of file LicenseAcknowledgementDao.php.

Member Data Documentation

◆ $dbManager

DbManager Fossology\Lib\Dao\LicenseAcknowledgementDao::$dbManager
private

DB manager in use

Definition at line 26 of file LicenseAcknowledgementDao.php.


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