Currently in \Drupal\og\Entity\OgMembership::baseFieldDefinitions we get the reference thank to those fields:
$fields['entity_type'] = BaseFieldDefinition::create('string')
->setLabel(t('Group entity type'))
->setDescription(t('The entity type of the group.'));
$fields['entity_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Group entity id.'))
->setDescription(t("The entity ID of the group."));
What if instead of those we had a (configurable) entity reference field?
Pros
An entity reference better describes what we really do here - an entity reference.
When we'll build the OgMembership forms for the admin to add users, we'll get the ER field's widget and selection handlers power.
Cons
If a site has groups of different entity types, this will require different Og membership types per referenced type. However I think this is going to be an edge case.
Not sure about it, just an idea.
Currently in
\Drupal\og\Entity\OgMembership::baseFieldDefinitions
we get the reference thank to those fields:What if instead of those we had a (configurable) entity reference field?
Pros
Cons
/cc @pfrenssen @damiankloip