function social_group_group_content_insert in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8.2 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8.3 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8.4 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8.5 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8.6 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 8.8 modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 10.3.x modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 10.0.x modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 10.1.x modules/social_features/social_group/social_group.module \social_group_group_content_insert()
- 10.2.x modules/social_features/social_group/social_group.module \social_group_group_content_insert()
When creating a new group membership.
Parameters
\Drupal\group\Entity\GroupContentInterface $group_content: The group content.
File
- modules/
social_features/ social_group/ social_group.module, line 887 - The Social group module.
Code
function social_group_group_content_insert(GroupContentInterface $group_content) {
if ($group_content
->getEntity()
->getEntityTypeId() == 'user') {
if ($group_content
->bundle() == $group_content
->getGroup()
->bundle() . '-group_membership') {
_social_group_grant_admin_role($group_content
->getEntity()
->id(), $group_content
->getGroup()
->id());
}
}
}