This document is a presentation on Drupal 8's entity API. It begins with introductions and an outline of topics to be covered. The document then defines what entities are in Drupal and provides examples. It explains the changes in how entities work between Drupal 7 and 8, including full CRUD support and revisions/translations. It discusses content entities versus config entities. Finally, it covers how to create a new entity type, including choosing base classes/handlers, writing annotations, and defining storage and routes. The goal is to help understand the new entity system in Drupal 8.
9. Tonight’s schedule
• What are entities?
• Major changes since Drupal 7
• Entities in Drupal 8
• Content & config entities
• Creating your own entity type
• Q&A
20. Entity handlers
• Storage
• Access control (no more user_access() for entities)
• Forms
• Views
• Listing
• Viewing
• Translation
21. Entity query
Works with any entity storage. If you don’t know the entity
type(’s storage), don’t use DB queries.
22. Content entities
• Fieldable
• Revisionable by default
• Stored in the database by default
• Do not define how a site or application works
• Class properties are now base fields (typed data)
23. Config entities
• Not fieldable
• Not revisionable by default
• Stored on file (and serialized in the database for
performance)
• Define how a site or application works
34. What have you learned?
• The differences between the entity APIs in Drupal 7
and 8.
• The differences between content and config
entities.
• How to create a new entity type in Drupal 8 and
why this is a good thing.