@staticmethod
def function_as_entity_handler(identifier, fn):
    """Supports legacy registering of entity handlers as functions."""
    return type('EntityHandlerRegisteredAsFunction', (object,), {
        'identifier': identifier, 'expand_db_attributes': staticmethod(fn)})
