public function EnrollActionBlock::getGroups in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.2 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.3 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.4 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.5 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.6 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.7 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 8.8 modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 10.3.x modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 10.1.x modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
- 10.2.x modules/social_features/social_event/src/Plugin/Block/EnrollActionBlock.php \Drupal\social_event\Plugin\Block\EnrollActionBlock::getGroups()
Get group object where event enrollment is posted in.
Returns an array of Group Objects.
Return value
array Group entities.
1 call to EnrollActionBlock::getGroups()
- EnrollActionBlock::blockAccess in modules/
social_features/ social_event/ src/ Plugin/ Block/ EnrollActionBlock.php - Custom access logic to display the block on the hero region for an event.
File
- modules/
social_features/ social_event/ src/ Plugin/ Block/ EnrollActionBlock.php, line 139
Class
- EnrollActionBlock
- Provides a 'EnrollActionBlock' block.
Namespace
Drupal\social_event\Plugin\BlockCode
public function getGroups($node) {
$groupcontents = GroupContent::loadByEntity($node);
$groups = [];
// Only react if it is actually posted inside a group.
if (!empty($groupcontents)) {
foreach ($groupcontents as $groupcontent) {
/** @var \Drupal\group\Entity\GroupContent $groupcontent */
$group = $groupcontent
->getGroup();
/** @var \Drupal\group\Entity\Group $group*/
$groups[] = $group;
}
}
return $groups;
}