Drupal 8's object-oriented Entity and Field APIs

Drupal 8's embrace of OOP has drastically affected many Drupal APIs: Entity and Field are among the major ones. Entities are now classed objects with interfaces. So are both Field data items and Field definitions. And also field formatters and widgets. This has added new capabilities, standardization and improved consistency, and simplifications throughout all code that works with entities and fields. In this session, we'll go over the various concepts, terminology, interfaces, and base classes involved in these APIs, and what it means for contrib modules, including:

  • What's involved in creating a new entity type, field type, formatter, or widget?
  • What are the similarities and differences between "config entities" (e.g., Views) and "content entities" (e.g., Nodes)?
  • What are the similarities and differences between "configurable fields" (e.g., $node->body) and "nonconfigurable fields" (e.g., $node->title)?
  • How can a module add miscellaneous data to an entity that it doesn't want stored as a field, but still have that data available to web services?
  • How are entity translations managed, and what do modules that work with entity data need to do to be multilingual compatible?
  • How are entities validated, both in response to form submissions as well as RESTful (non-form-based) web service submissions?
Saturday, Oct 26th
4:00pm - 4:45pm


Skill Level