Habari\Comments::delete_by_status PHP Method

delete_by_status() public static method

delete all the comments and commentinfo for comments with this status
public static delete_by_status ( integer | string $status )
$status integer | string a comment status ID or name
    public static function delete_by_status($status)
    {
        $status = Comment::status($status);
        // first, purge all the comments
        DB::query('DELETE FROM {comments} WHERE status=?', array($status));
        // now purge any commentinfo records from those comments
        DB::query('DELETE FROM {commentinfo} WHERE comment_id NOT IN ( SELECT id FROM {comments} )');
    }