By manuelBS on
Hi, i just installed ECK. I dont know when to create a new entity and when to create a new bundle. Could anybody tell me, what is the difference between these two things? Is creating a bundle like inheriting from an object?
Thanks for any answer.
Comments
Look at content, node is an
Look at content, node is an entity, each content type is a bundle. Why not simply use content types?
Yes, thats what i thougt,
Yes, thats what i thought, too.
When do you decide to use a new content type instead of creating a new entity or bundle?
ERPAL - Drupal business applications
Drupal security update automation
I would stick with content
I would stick with content types unless you have a good reason not to.
OK. What would be a "good"
OK. What would be a "good" reason for you?
ERPAL - Drupal business applications
Drupal security update automation
Good Reasons
Well, if everything goes as I think it will, entities will be replacing nodes as they will be more flexible in their structure and in their functionality.
Right now with ECK you can almost do anything you could do with a node, but since entities are fairly new, there isn't a comparable amount of modules to extend entities as there are for nodes.
So, if you want to help make entities better, use entities. If you mainly need chunks of what node does but not all of it, use entities. If you want to develop very custom functionality around a persistent storage (that is what an entity is), use entities. If you need functionality that only exists for nodes at the moment (like node_access, etc) then use node.
Now, about entity type vs bundle, I would recommend reading this simple tutorial on ECK: Tutorial. It not only deals with how to use ECK, but also with my personal views on entity types vs bundles.
Here is something to keep in mind while reading the tutorial. There isn't that much functionality built around entity's properties, which are the things that entities are made off (ex. node has a published property, a sticky property, a created and changed properties etc), so the majority of people (unless you are a developer) will be working with fields.
Nodes are entities, at this
Nodes are entities, at this time more modules are tied to nodes than entities in general.
Right
Right, that is what I meant by functionality that is only available for nodes. There are definitely a lot more modules that help nodes be more useful, so when in doubt, use nodes. If you are a programmer and are not afraid of helping out bringing some of that functionality to a more general place for entities, then go with entities.