public static function create_from_user(\stdClass $user, $forgottenreset = false) {
        $data = array(
            'context' => \context_user::instance($user->id),
            'relateduserid' => $user->id,
            'other' => array('forgottenreset' => $forgottenreset),
        );
        $event = self::create($data);
        $event->add_record_snapshot('user', $user);
        return $event;
    }