Data Model for Rooms, Time Slots, and Sessions

Last updated on
28 April 2017

COD for Drupal 7 has a significantly different data model for associating room, time slots, and sessions (or BoFs or schedule items) together. In particular a special entity type is used to represent that certain schedule types (e.g. session vs BoF) are allowed in a certain room at a certain time.

There is a Field Collection entity, which has 3 fields:

  1. Allowed Types (session, schedule item, BoF)
  2. Capacity (number of sessions or BoFs the can be simultaneous in a particular room)
  3. Time Slot (an entity reference to a time_slot node)

Each field collection entity is referenced from only one room node. The widget for creating the field collection entities is set as hidden and instead the entities are created by using the form at the /admin/conference/config/schedule page for each day. Note that you need to create some time slots and possible do a cache clear before that page will be available. A room node can reference multiple of the field collection entities, basically determining the available time slots for that room, and which schedule types (e.g. session vs. BoF) can be in a room at a given time.

Each session, schedule item, or BoF has an entity reference to a single field collection entity, and the selector widget is filtered based on #1 above using a view, so e.g. on a session node you only see field collection items where session is an allowed type.

In order to create a single View that pulls in all the data for the schedule (e.g. to make a session grid) you need to make the View of the field collection entities, and then add 3 relationships, to the time slot referenced by the entity, the session or other schedule node referencing the entity, and the room referencing the entity.

Such a view can bee seen in this sandbox module: http://drupal.org/sandbox/pwolanin/1884410