Mark a report as resolved or invalid.

@param int $id
@param int $status
@param int $user_id
@param string $comment
@return bool
352198
public function markAs($id, $status, $user_id, $comment = null) {
        $this->id = $id;

        return $this->save(array(
            'status' => $status,
            'resolver_id' => $user_id,
            'comment' => $comment
        ));
    }
643072
protected function _deleteObject( $comment_id ) {
		$comment = get_comment( $comment_id );
		if ( ! $comment || is_wp_error( $comment ) ) {
			return false;
		}

		$deleted = wp_delete_comment( $comment_id, true );
		if ( $deleted ) {
			$this->_debug( 'Deleted comment with ID: ' . $comment_id );
			return true;
		}

		$this->_debug( 'Comment removal failed for ID: ' . $comment_id );
		return false;
	}
624472
def on_status_withheld(self, status_id, user_id, countries):
        """"""
        logger.info('Status %s withheld for user %s', status_id, user_id)
        return True
1089252
public function commentAction(Request $request, $resourceId, User $user)
    {
        $text = $request->get('social_media_comment_text');

        if ($text !== null) {
            $comment = new CommentAction();
            $comment->setText($text);
            $comment->setUser($user);
            $commentManager = $this->getCommentActionManager();
            $userIds = $commentManager->getHasCommentedUserIds($resourceId);
            $commentManager->createComment($resourceId, $comment);
            $this->dispatchCommentEvent($comment, $userIds);
        }
        if ($request->isXmlHttpRequest()) {
            $response = new JsonResponse(true);
        } else {
            $response = $this->redirectToRoute('icap_socialmedia_comments_view', array('resourceId' => $resourceId));
        }

        return $response;
    }
1319416
public function setIssueStatus($id, $status)
    {
        $api = $this->client->issue_status;
        $statusId = $api->getIdByName($status);

        return $this->update($id, [
            'status_id' => $statusId,
        ]);
    }
40947
def _invalid(m, comment=INVALID_RESPONSE, out=None):
    '''
    
    '''
    return _set_status(m, status=False, comment=comment, out=out)
700637
public function deleteComment(int $commentId): bool
    {
        if ( ! $this->validateId($commentId)) {
            return false;
        }

        $result = $this->delete('comments/' . $commentId);

        return 204 === $result->getStatusCode();
    }
409927
public function UpdateUser($UserID, $Inc = FALSE) {
      if ($Inc) {
         // Just increment the comment count.
         $this->SQL
            ->Update('User')
            ->Set('CountComments', 'CountComments + 1', FALSE)
            ->Where('UserID', $UserID)
            ->Put();
      } else {
         // Retrieve a comment count
         $CountComments = $this->SQL
            ->Select('c.CommentID', 'count', 'CountComments')
            ->From('Comment c')
            ->Where('c.InsertUserID', $UserID)
            ->Get()
            ->FirstRow()
            ->CountComments;

         // Save to the attributes column of the user table for this user.
         Gdn::UserModel()->SetField($UserID, 'CountComments', $CountComments);
      }
   }
1302914
function mark_edited($user_id = 0, $reason = '')
	{
		if($user_id = 0)
		{
			global $user;
			$user_id = $user->data['user_id'];
		}
		$this->post_edit_count++;
		$this->post_edit_time = time();
		$this->post_edit_user = $user_id;
		$this->post_edit_reason = $reason;
	}
686073
protected function setStatusReview($status)
    {
        $id = $this->getParam(0);
        $all = $this->getParam('all');

        if (!isset($id) && empty($all)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (isset($id) && (empty($id) || !is_numeric($id))) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $options = null;

        if (isset($id)) {

            if ($this->getParam('user')) {
                $options = array('user_id' => $id);
            } else if ($this->getParam('product')) {
                $options = array('product_id' => $id);
            }

        } else if (!empty($all)) {
            $options = array();
        }

        if (isset($options)) {

            $deleted = $count = 0;
            foreach ($this->review->getList($options) as $item) {
                $count++;
                $deleted += (int) $this->review->update($item['review_id'], array('status' => $status));
            }

            $result = $count && $count == $deleted;

        } else if (!empty($id)) {
            $result = $this->review->update($id, array('status' => $status));
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
688541
public void updateCommentStatus(final long postId,
                                   final Post.CommentStatus commentStatus,
                                   final Post.CommentStatus pingStatus) throws SQLException {
      Connection conn = null;
      PreparedStatement stmt = null;
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(updatePostCommentStatusSQL);
         stmt.setString(1, commentStatus.toString().toLowerCase());
         stmt.setString(2, pingStatus.toString().toLowerCase());
         stmt.setLong(3, postId);
         stmt.executeUpdate();
      } finally {
         SQLUtil.closeQuietly(conn, stmt);
      }
   }
20781
public function replaceCommentAuthor(User $from, User $to)
    {
        $comments = $this->repo->findByAuthor($from);

        if (count($comments) > 0) {
            foreach ($comments as $comment) {
                $comment->setAuthor($to);
            }

            $this->om->flush();
        }

        return count($comments);
    }
310939
function markForRemoval(id, mark) {
        if (mark) {
            _idsToRemove[id] = true;
        } else {
            delete _idsToRemove[id];
        }
        exports.trigger("statusChange", id);
    }
1075271
public function addCommentToHistory(EntityInterface $entity, string $comment, string $userId = null): ModelHistory
    {
        if (!$userId) {
            $userId = $this->_getUserId();
        }

        return $this->ModelHistory->addComment($entity, $comment, $userId);
    }
1160369
public function delete($commentId)
    {
        $db = $this->getDb();
        $db->startTransaction();

        $deleteResult = $db->execute('DELETE FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_commentid` = ' . $db->quote($commentId));

        $result = ($deleteResult !== false);

        if ($result) {
            $db->commitTransaction();
        } else {
            $db->rollbackTransaction();
        }

        return $result;
    }
630011
public function getDeliveryExecutionsByStatus($userUri, $status)
    {
        $query = $this->getQueryBuilder()
            ->select("*")
            ->from(self::TABLE_NAME)
            ->where(self::COLUMN_USER_ID . " = :userId")
            ->andWhere(self::COLUMN_STATUS . " = :status")
            ->setParameter("userId", $userUri)
            ->setParameter("status", $status)
        ;

        return array_map(function($row) {
            return $this->parseQueryResult($row);
        }, $query->execute()->fetchAll());
    }
359732
public function getComment($comment_id)
    {
        list($response, $statusCode, $httpHeader) = $this->getCommentWithHttpInfo ($comment_id);
        return $response; 
    }