1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest ProfilePost model missing basic delete function?

Discussion in 'Closed Suggestions' started by Jaxel, May 13, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    I am using the following two codes to hard delete threads and posts:
    Code:
    if ($thread['delete_age'] > $cutoff)
    {
    $this->getModelFromCache('XenForo_Model_Thread')->deleteThread($thread['thread_id'], 'hard');
    XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
    }
    Code:
    if ($post['delete_age'] > $cutoff)
    {
    $this->getModelFromCache('XenForo_Model_Post')->deletePost($post['post_id'], 'hard');
    XenForo_Helper_Cookie::clearIdFromCookie($post['post_id'], 'inlinemod_posts');
    }
    Very simple right? However, the same can not be done with Profile Posts... I must instead do...
    Code:
    if ($profile_post['delete_age'] > $cutoff)
    {
    $dw = XenForo_DataWriter::create('XenForo_DataWriter_DiscussionMessage_ProfilePost');
    $dw->setExistingData($profile_post['profile_post_id']);
    $dw->delete();
    
    XenForo_Helper_Cookie::clearIdFromCookie($profile_post['profile_post_id'], 'inlinemod_profilePosts');
    $this->getModelFromCache('XenForo_Model_DeletionLog')->removeDeletionLog('profile_post', $profile_post['content_id']);
    }
    You'll notice that no only do I need to manually write the delete code... but I must ALSO delete the entry for the deletion log, which is missing from the profilepost datawriter.
     

Share This Page