Is extending entities an option?

wrburgess's picture

After attending DrupalCon Chicago, I heard a lot about the Entity system in Drupal 7. Entities seem to be an abstraction layer that covers nodes, users, taxonomies and the like.

Does anyone know if you could extend an entity type to represent players, teams, leagues, and stats? I don't think mixing those "entities" with nodes is the solution, but I don't know enough about the new entity system to comment, yet.



james_g's picture

The Entity API allows you to create your own entity types. There is a handbook page here that describes the process. It is entirely possible to represent players, teams, leagues, stats, etc. as entities. Whether or not to utilize nodes is dependent on your needs.
Personally, I would tend to associate most of that with nodes. A node, at its core, is just a title/body(optional) with some utility data like author, created date, etc. A Player, team, and league would all have a title or name.

This is my plan ...

jthorson's picture

Not sure how I missed this post earlier ... but my plan with regards to the 'One League API' initiative I intend on spearheading over the next 6 months or so is to create a suite of common entities/nodes/fields to represent the various components (players, teams, rosters, games, stats, etc) involved in league managment activities.

More details should be appearing within this group shortly.