The constants are called DimensionContentInterface::STAGE_DRAFT and STAGE_LIVE. If you change content by code, publish only what was published before. Otherwise open changes go live with it.