Skip to main content

Comment events

Fired around the comment subsystem and the per-category thread integration. Comment events fire from Listener after entity save/delete commits, so they run after the transaction settles.

Events

EventSignatureWhen
mc_dm_comment_post_save(Comment $comment)After a comment is created or edited. Fires for every save (insert and update).
mc_dm_comment_post_delete(Comment $comment)After a comment is hard-deleted. Soft deletes flip comment_state and fire post_save, not this event.
mc_dm_thread_settings_changed(Category $category)After category-level thread settings (thread_mode, thread_forum_id, etc.) change. Use it to rebuild any cached per-category thread routing.

Soft vs hard delete

Soft delete flips comment_state to deleted and fires mc_dm_comment_post_save. Inspect the changed state to react to it. Hard delete fires mc_dm_comment_post_delete and the row is gone by the time the listener runs.

Example

public static function commentPostSave(\MC\DownloadsManager\Entity\Comment $comment)
{
if ($comment->isInsert())
{
// notify the download author
}
}