public static function SetGroupsForNodeService::addGroupContent in Open Social 8.9
Same name and namespace in other branches
- 8 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.2 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.3 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.4 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.5 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.6 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.7 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 8.8 modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 10.3.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 10.0.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 10.1.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
- 10.2.x modules/social_features/social_group/src/SetGroupsForNodeService.php \Drupal\social_group\SetGroupsForNodeService::addGroupContent()
Creates 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::addGroupContent()
- 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 165
Class
- SetGroupsForNodeService
- Class SetGroupsForNodeService.
Namespace
Drupal\social_groupCode
public static function addGroupContent(NodeInterface $node, Group $group) {
// TODO Check if group plugin id exists.
$plugin_id = 'group_node:' . $node
->bundle();
$group
->addContent($node, $plugin_id, [
'uid' => $node
->getOwnerId(),
]);
}