'Serialize LoId, generally for use in the event pipeline.'

def to_dict(self, prefix=None):

    if (not self.serializable):
        return {}
    d = {'loid': self.loid, 'loid_created': to_epoch_milliseconds(self.created), 'loid_new': self.new, 'loid_version': self.version}
    hook = hooks.get_hook('loid.to_dict')
    hook.call(loid=self, data=d)
    if prefix:
        d = {'{}{}'.format(prefix, k): v for (k, v) in d.iteritems()}
    return d
