You are here

function ggroup_group_content_insert in Subgroup (Graph) 1.0.x

Implements hook_ENTITY_TYPE_insert().

File

./ggroup.module, line 34
Enables Subgroup functionality.

Code

function ggroup_group_content_insert(GroupContentInterface $group_content) {
  if ($group_content
    ->getContentPlugin()
    ->getEntityTypeId() !== 'group') {
    return;
  }
  \Drupal::service('ggroup.group_hierarchy_manager')
    ->addSubgroup($group_content);
}