While creating a new information for Drupal 8, I came across 2 approaches to create a new column on the entity table on database: * use hook_schema() (as I was used on Drupal 7) (https://gist.github.com/pedrorocha-net/3ed63f33b513d9c9ff86) * extends ContentEntityBase and use BaseFieldDefinition (https://gist.github.com/pedrorocha-net/70d6a84c3ddba1c5939d)
Both alternatives creates the table for me, with the data, but I think the latter already provides me more integration with other Drupal components e.g. Views module. By the other hand, being an "Entity" I believe brings some "weight" to the data, as it works with some wrappers(on Drupal 7 at least).
What i'm doing is port the Voting API module, so this question about extra weight can really impact on sites with more content.
Any thoughts?
stdClass
objects, and it has more overhead compared to the native entities used by Drupal 8. – kiamlaluno♦ Aug 17 '15 at 14:54