By kristiaanvandeneynde on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
2.0.x
Introduced in version:
2.0.0
Description:
Before:
$plugin_manager = \Drupal::service('plugin.manager.group_content_enabler');- Plugin definitions were arrays
After:
$plugin_manager = \Drupal::service('group_relation_type.manager');- Plugin definitions are classes of type \Drupal\group\Plugin\Group\Relation\GroupRelationType
This now follows the exact same structure as entity types with one exception: GroupRelationType plugins allow for derivatives whereas EntityType plugins do not (as far as I know).
So:
- An instance of a plugin is a group relation (versus an entity)
- The definition of said plugin is a group relation type (versus an entity type)
All related methods for retrieving plugins have been renamed across the code base, no more fooContentPlugin(), but rather:
$group->getGroupType()->getRelationPlugin($plugin_id)$group->getGroupType()->hasRelationPlugin($plugin_id)- Etc.
Special note about plugin IDs
Because we're allowing derivatives, to get the actual plugin ID, you need to either call getRelationTypeId() on the plugin instance or get the keys from the array returned by the manager when retrieving a list of plugin definitions. If you want the BASE plugin ID, you need to load the actual plugin definition (group relation type) and call id() on that one.
Impacts:
Module developers
Site templates, recipes and distribution developers