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

Public Member Functions

 __construct (DbManager $dbManager)
 
 getAllComments ($skipNotSet=false)
 
 updateComment ($commentPk, $newName, $newComment)
 
 insertComment ($name, $comment)
 
 updateCommentFromArray ($commentArray)
 Update the comments based only on the values provided. More...
 
 getComment ($commentPk)
 
 toggleComment ($commentPk)
 

Private Member Functions

 isCommentIdValid ($commentPk)
 

Private Attributes

 $dbManager
 

Detailed Description

DAO layer for license_std_comment table.

Definition at line 22 of file LicenseStdCommentDao.php.

Member Function Documentation

◆ getAllComments()

Fossology\Lib\Dao\LicenseStdCommentDao::getAllComments (   $skipNotSet = false)

Get all the comments 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 comments from the DB

Definition at line 40 of file LicenseStdCommentDao.php.

◆ getComment()

Fossology\Lib\Dao\LicenseStdCommentDao::getComment (   $commentPk)

Get the comment for the given comment id

Parameters
int$commentPkThe comment id
Returns
string|null Comment from the DB (if set, null otherwise)

Definition at line 177 of file LicenseStdCommentDao.php.

◆ insertComment()

Fossology\Lib\Dao\LicenseStdCommentDao::insertComment (   $name,
  $comment 
)

Insert a new comment

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

Definition at line 87 of file LicenseStdCommentDao.php.

◆ isCommentIdValid()

Fossology\Lib\Dao\LicenseStdCommentDao::isCommentIdValid (   $commentPk)
private

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

Parameters
int$commentPkComment id to check for
Exceptions

Definition at line 221 of file LicenseStdCommentDao.php.

◆ toggleComment()

Fossology\Lib\Dao\LicenseStdCommentDao::toggleComment (   $commentPk)

Toggle comment status.

Parameters
int$commentPkThe comment id
Returns
boolean True if the comment is toggled, false otherwise.

Definition at line 197 of file LicenseStdCommentDao.php.

◆ updateComment()

Fossology\Lib\Dao\LicenseStdCommentDao::updateComment (   $commentPk,
  $newName,
  $newComment 
)

Update single comment

Parameters
int$commentPkThe comment id
string$newNameNew name of the comment
string$newCommentUpdated comment
Returns
boolean True if the comments are updated, false otherwise.

Definition at line 59 of file LicenseStdCommentDao.php.

◆ updateCommentFromArray()

Fossology\Lib\Dao\LicenseStdCommentDao::updateCommentFromArray (   $commentArray)

Update the comments based only on the values provided.

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

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

Definition at line 131 of file LicenseStdCommentDao.php.

Member Data Documentation

◆ $dbManager

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

DB manager in use

Definition at line 26 of file LicenseStdCommentDao.php.


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