I've been trying to figure out this problem of allowing the user to dynamically create project request forms (add his own fields including drop downs, multiselects, etc...). The user needs a way to create multiple project request types (bundles, perhaps?), for different business units. I figured the entity / bundle relationship would be perfect for this. So here is my idea:
Use the Schema API to define my base table "project". Use the Entity API hook_entity_info() to tell Drupal about my new entity, pointing it to the "project" table. Now in this hook I can define bundles - which is great. But I need for the user to be able to create a bundle. Where is the entity_create_bundle($entity_type, $bundle) call?
Entity TYPE: Project (with common fields defined in DB, and it is fieldable)
Bundle: IT Project, HR Project - which share the common fields from Project
A project_type table will store additional grouping I need (project requests for business units).
Now I've been reading Drupal 7 Module Development which has been great, and in chapter 6 they define an entity "artwork" that has a couple of bundles, "sculpture" and "painting". The way they describe the steps, is as if they are building an admin interface to create additional artwork types, but this is not true (from what I can tell). After finishing the chapter, I can only create entities of type "painting" or "sculpture".
How can I allow users to create bundles of the "project" entity type?
Am I missing something or is the functionality not there [yet]?