The ECK module allows users to create custom entities.
When using this modules UI it is possible to create an entity type, and then attach multiple bundles to the entity.
It is also possible to create new entity types via code. This page shows an example which is as follows:
$entity_type = new EntityType(); $entity_type->name = "eck_employee"; $entity_type->label = "Employee"; // Following line is taken from the eck_example.install file $entity_type->addProperty('name', 'Name', 'text'); $entity_type->save();
This doesn't however show how to create and attach bundles.
Is it possible to attach bundles to entities when creating them via code (using ECK)?