I think it's hackish to rely on `getId()`. It's not in the interface, and there may be cases where a variant has not have been saved yet and does not have an id.