Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
CommentDAO Class Reference
Inheritance diagram for CommentDAO:
DAO

Public Member Functions

_returnCommentFromRow ($row, $childLevels=0)
 
 attributedCommentsExistForUser ($userId)
 
 CommentDAO ()
 
 decrementChildCount ($commentId)
 
 deleteBySubmissionId ($submissionId)
 
 deleteComment (&$comment, $isRecursing=false)
 
getById ($commentId, $submissionId, $childLevels=0)
 
getByUserId ($userId)
 
getCommentsByParentId ($parentId, $childLevels=0)
 
 getInsertCommentId ()
 
getRootCommentsBySubmissionId ($submissionId, $childLevels=0)
 
 incrementChildCount ($commentId)
 
 insertComment (&$comment)
 
 newDataObject ()
 
 updateComment (&$comment)
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
 getDataChangedEvent ($elementId=null, $parentElementId=null)
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getInsertId ($table= '', $id= '', $callHooks=true)
 
 getType ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource (&$dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 

Additional Inherited Members

- Public Attributes inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and modifying Comment objects.

See Also
Comment

Definition at line 28 of file CommentDAO.inc.php.

Member Function Documentation

& CommentDAO::_returnCommentFromRow (   $row,
  $childLevels = 0 
)

Creates and returns a submission comment object from a row

Parameters
$rowarray
Returns
Comment object

Definition at line 156 of file CommentDAO.inc.php.

References HookRegistry\call(), DAO\datetimeFromDB(), getCommentsByParentId(), DAORegistry\getDAO(), and newDataObject().

Referenced by getById(), getByUserId(), getCommentsByParentId(), and getRootCommentsBySubmissionId().

CommentDAO::attributedCommentsExistForUser (   $userId)

Check whether any reader comments are attributed to the user.

Parameters
$userIdint The ID of the user to check
Returns
boolean

Definition at line 112 of file CommentDAO.inc.php.

References DAO\retrieve().

CommentDAO::CommentDAO ( )

Constructor

Definition at line 32 of file CommentDAO.inc.php.

CommentDAO::decrementChildCount (   $commentId)

Decrease the current count of child comments for the specified comment.

Parameters
commentIdint

Definition at line 236 of file CommentDAO.inc.php.

References DAO\update().

Referenced by deleteComment().

CommentDAO::deleteBySubmissionId (   $submissionId)

Removes submission comments by submission ID

Parameters
$submissionIdint

Definition at line 256 of file CommentDAO.inc.php.

References DAO\update().

CommentDAO::deleteComment ( $comment,
  $isRecursing = false 
)

Removes a submission comment from comments table

Parameters
Commentobject

Definition at line 244 of file CommentDAO.inc.php.

References decrementChildCount(), and DAO\update().

& CommentDAO::getById (   $commentId,
  $submissionId,
  $childLevels = 0 
)

Retrieve Comment by comment id

Parameters
$commentIdint
$submissionIdint optional
$childLevelsint optional
Returns
Comment object

Definition at line 126 of file CommentDAO.inc.php.

References _returnCommentFromRow(), and DAO\retrieve().

& CommentDAO::getByUserId (   $userId)

Retrieve comments by user id

Parameters
$userIdint
Returns
Comment objects array

Definition at line 91 of file CommentDAO.inc.php.

References _returnCommentFromRow(), and DAO\retrieve().

& CommentDAO::getCommentsByParentId (   $parentId,
  $childLevels = 0 
)

Retrieve Comments by parent comment id

Parameters
$parentIdint
Returns
Comment objects array

Definition at line 70 of file CommentDAO.inc.php.

References _returnCommentFromRow(), and DAO\retrieve().

Referenced by _returnCommentFromRow().

CommentDAO::getInsertCommentId ( )

Get the ID of the last inserted submission comment.

Returns
int

Definition at line 220 of file CommentDAO.inc.php.

References DAO\getInsertId().

Referenced by insertComment().

& CommentDAO::getRootCommentsBySubmissionId (   $submissionId,
  $childLevels = 0 
)

Retrieve Comments by submission id

Parameters
$submissionIdint
$childLevelsint optional
Returns
Comment objects array

Definition at line 42 of file CommentDAO.inc.php.

References _returnCommentFromRow(), and DAO\retrieve().

CommentDAO::incrementChildCount (   $commentId)

Increase the current count of child comments for the specified comment.

Parameters
commentIdint

Definition at line 228 of file CommentDAO.inc.php.

References DAO\update().

Referenced by insertComment().

CommentDAO::insertComment ( $comment)

inserts a new submission comment into comments table

Parameters
Commentobject
Returns
int ID of new comment

Definition at line 186 of file CommentDAO.inc.php.

References DAO\datetimeToDB(), Core\getCurrentDate(), getInsertCommentId(), incrementChildCount(), String\substr(), and DAO\update().

CommentDAO::newDataObject ( )

Instantiate and return a new data object.

Returns
DataObject

Definition at line 147 of file CommentDAO.inc.php.

Referenced by _returnCommentFromRow().

CommentDAO::updateComment ( $comment)

updates a comment

Parameters
Commentobject

Definition at line 267 of file CommentDAO.inc.php.

References DAO\datetimeToDB(), Core\getCurrentDate(), String\substr(), and DAO\update().


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