Hi I'd like a feature whereby there is support to reference another entity from an entity's field, just like ordinary/traditional Drupal (using local MySQL database) does.

This would take the form of 2 operations:

1) Initial setup of the Entity Reference: On creating a field in an entity which is an Entity Reference, in the standard Drupal Content editor, calls are made to the external data source to create a relationship between the data for the entities. This operation should cover both creation of the Entity reference field and deletion, for when the field is deleted from the entity.

2) Accessing data (read/write) from the field in the entity. Because the field references another entity, a call must be made to the external data source.

As a concrete/real-life example, this could be a REST call to a Node JS-based external API microservice, which is the interface to an external, non-Drupal Postgres database. The implementation of the relationship creation could be a series of SQL commands, e.g. to setup a foreign key between the entities. Then for access to the field, another API call would be used and the API would support it, implementing it as a series of SQL commands to access the other entity.

The implementation of the REST call on the API side is bespoke and would be implemented per project.

However the interface/protocol/API call structure definition that Drupal makes, via this module (External Entities) (probably as an extension plug-in) is standardised.

The API side has to support this standard interface for this functionality to work - so that it can respond to the call from Drupal. But how it implements it is up to the developer and is a separate activity from the Drupal side.

What this all means is that not only is the data decoupled from Drupal and/or allowing interoperation with other data sources, it also means that the relationships between that external data are modelled within that data source itself. So there is not a dependency on Drupal to manage the relationships. However, Drupal provides the benefit of the generic standardised interface to model those relationships via entity editors such as the Content Type editor.

Comments

therobyouknow created an issue.