You are here

function comment_notify_mark_comment_as_notified in Comment Notify 8

Same name and namespace in other branches
  1. 7 comment_notify.inc \comment_notify_mark_comment_as_notified()

Records that the owner of a comment notification request has been notified.

Parameters

int $comment: The comment ID.

Return value

bool True if it can be updated correctly.

2 calls to comment_notify_mark_comment_as_notified()
CommentNotifyMigrationHandler::complete in ./comment_notify.migrate.inc
Implements MigrateDestinationHandler::complete().
_comment_notify_mailalert in ./comment_notify.module
Private function to send the notifications.

File

./comment_notify.inc, line 140
Contains functions which utilize the database and other internal helpers.

Code

function comment_notify_mark_comment_as_notified($comment) {

  // First, mark the passed comment (an object, so passed by reference).
  $comment->notified = 1;

  // Next, store this fact in the DB as well.
  return (bool) \Drupal::database()
    ->update('comment_notify')
    ->fields([
    'notified' => 1,
  ])
    ->condition('cid', $comment
    ->id())
    ->execute();
}