When listening to XenForo_DataWriter_DiscussionMessage_Post, what is the right way to tell if it is saving a draft? I am seeing multiple XenForo_DataWriter_DiscussionMessage_Post events for a post, presumably it relates to draft?
The intention is to monitor the save() method and do additional stuff related to the post, but only if it is the final save that commits the post.
Any help and suggestion would be much appreciated. Thanks.
OK, it appears that the additional XenForo_DataWriter_DiscussionMessage_Post is coming from editing an existing post.....
I am trying to extract data from a post, and store them in a separate table, indexed by the post_id. I guess I will need to delete existing reference in my separate table, or do an update instead of insert (though this may be a bit involved).
A related question is referential integrity, is this currently supported? i.e. deleting a post will delete associated data rows - note that these are in my separate table and not the standard set of tables.