Biblio/Contributor entities have already been implemented. Next up is getting the Contribution entity working.
The contribution entity will contain two entity reference fields. One referencing a Biblio entity, and the other referencing a Contributor entity. This will eliminate the current M:N relationship between Biblios and Contributors (same concept as a join table in a database).
The Contribution entity will have the following bundles (taken from author category):

  • primary
  • secondary
  • tertiary
  • subsidiary
  • corporate-institutional

Contributors associated with the "primary" bundle should be listed as Primary Authors, "secondary" listed as Secondary Authors, etc.

A hook_entity_info entry should be added for the new entity, as well as CRUD functions and other helper functions.

Comments

smithdalec’s picture

Title: Contribution entity implementation » Biblio/Contributor relationship (Contribution entity)

The Contribution entity is implemented, using two entity references: biblio_ref and contributor_ref, and it works.
I've found that, although the proper way to do this in a database, this isn't the best way to handle the Biblio <--> Contributor relationship using Drupal's Entity system. It has led to bloated code, and is painful to work with in Views.

I'm now thinking that the "Drupal way" to do this would be to implement 5 entity reference fields (one for each contributor category) in the Biblio entity, referencing a Contributor entity.
The problem I see with this, however, is that entity reference fields can only reference entities that already exist. A separate field widget/handler/formatter may be needed to auto-create Contributor entities.

smithdalec’s picture

Status: Active » Closed (works as designed)

Contribution entities are now gone. Replaced with 5 entity reference fields in the biblio entity referencing the contributor entity.
Everything seems to be working smoothly.