public static function SetGroupsForNodeService::removeGroupContent in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8.2 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8.3 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8.4 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8.5 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8.6 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 8.7 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 10.3.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 10.0.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 10.1.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
- 10.2.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::removeGroupContent()
Deletes a group content.
Parameters
\Drupal\node\NodeInterface $node: Object of a node.
\Drupal\group\Entity\Group $group: Object of a group.
1 call to SetGroupsForNodeService::removeGroupContent()
- SetGroupsForNodeService::setGroupsForNode in modules/
social_features/ social_group/ src/ SetGroupsForNodeService.php - Save groups for a given node.
File
- modules/
social_features/ social_group/ src/ SetGroupsForNodeService.php, line 179
Class
- SetGroupsForNodeService
- Class SetGroupsForNodeService.
Namespace
Drupal\social_groupCode
public static function removeGroupContent(NodeInterface $node, Group $group) {
// Try to load group content from entity.
if ($group_contents = GroupContent::loadByEntity($node)) {
/* @var @param \Drupal\group\Entity\GroupContent $group_content */
foreach ($group_contents as $group_content) {
if ($group
->id() === $group_content
->getGroup()
->id()) {
$group_content
->delete();
}
}
}
}