public static function create_from_tag_instance($taginstance, $tagname, $tagrawname, $addsnapshot = false) {
        $event = self::create(array(
            'objectid' => $taginstance->id,
            'contextid' => $taginstance->contextid,
            'other' => array(
                'tagid' => $taginstance->tagid,
                'tagname' => $tagname,
                'tagrawname' => $tagrawname,
                'itemid' => $taginstance->itemid,
                'itemtype' => $taginstance->itemtype
            )
        ));
        if ($addsnapshot) {
            $event->add_record_snapshot('tag_instance', $taginstance);
        }
        return $event;
    }