def METHOD_NAME(collection, aggregator, entity_id=None):
    """In order to make the profile_id visible on entities in a collection,
    we generate stub entities in the FtM store that contain only a context.
    """
    aggregator.delete(origin=ORIGIN)
    writer = aggregator.bulk()
    profile_id = None
    for profile_id, entity_id in EntitySet.all_profiles(
        collection.id, entity_id=entity_id
    ):
        data = {"id": entity_id, "schema": Entity.THING, "profile_id": profile_id}
        writer.put(model.get_proxy(data), origin=ORIGIN)
    writer.flush()
    return profile_id