Getting the bundle of an existing entity instance

If you have a reference to an entity instance in a bundle, you can use the object.Bundle property to get a reference to its bundle. Use this property if you want entity changes to happen with existing changes that you know are in a writable bundle.

For example, you can use the bundle reference and call its add method to include additional entity instances. When PolicyCenter commits that bundle, all changes to the database happen in one database transaction.

See also