public static function create_from_tag($tag) {
        $event = self::create(array(
            'objectid' => $tag->id,
            'relateduserid' => $tag->userid,
            'context' => \context_system::instance(),
            'other' => array(
                'name' => $tag->name,
                'rawname' => $tag->rawname
            )
        ));
        return $event;
    }
public static function create_from_tag($tag) {
        $event = self::create(array(
            'objectid' => $tag->id,
            'relateduserid' => $tag->userid,
            'context' => \context_system::instance(),
            'other' => array(
                'name' => $tag->name,
                'rawname' => $tag->rawname
            )
        ));
        return $event;
    }
public static function create_from_tag ( $ tag ) { $ event = self :: create ( array ( 'objectid' => $ tag -> id , 'relateduserid' => $ tag -> userid , 'context' => \ context_system :: instance ( ) , 'other' => array ( 'name' => $ tag -> name , 'rawname' => $ tag -> rawname ) ) ) ; return $ event ; }
Creates an event from tag object

@since Moodle 3.1
@param \core_tag_tag|\stdClass $tag
@return tag_created
Creates an event from tag object