~/talk

Using bundle classes to build content types with built-in behaviors

Talkat DrupalCamp NJ 2026 · 2026-03-12..03-14· [drupal, software-architecture]
links:none on file
slides:none on file

Shows how Drupal entity bundle classes replace scattered hooks and subscribers by putting content-type rules into PHP classes wired with hook_entity_bundle_info_alter. Concrete examples: featureable interface with news returning false if older than 45 days, teaserable trait for summaries and canonical URLs, a readtime service that divides word count by 220 wpm, and an entity-knowledge interface with getKnowledgeEntities / setKnowledgeParent / setKnowledgeStatus for search-index syncing. Code and examples live at https://github.com/nJim/entity-bundles-examples

AI-written summary · about

  1. 0:00Introduction to bundle classes
  2. 1:04Why bundle classes matter
  3. 3:52Object-oriented design problem
  4. 10:17Composition over inheritance
  5. 13:06Behavior strategies in Drupal
  6. 16:37Setting up bundle classes
  7. 19:05Featureable interface demo
  8. 22:38Teaserable trait and interfaces
  9. 25:04Read time behavior service
  10. 27:56Production example with standards
  11. 32:13Mechanics and implementation tips
  12. 36:27Design notes and best practices
  13. 38:10Adopting bundle classes incrementally
  14. 39:33Q&A: When to refactor
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.