public function EnrollActionForm::getGroups in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.2 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.3 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.4 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.5 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.6 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.7 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 8.8 modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 10.3.x modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 10.1.x modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
- 10.2.x modules/social_features/social_event/src/Form/EnrollActionForm.php \Drupal\social_event\Form\EnrollActionForm::getGroups()
Get group object where event enrollment is posted in.
Returns an array of Group Objects.
Return value
array Array of group entities.
1 call to EnrollActionForm::getGroups()
- EnrollActionForm::buildForm in modules/
social_features/ social_event/ src/ Form/ EnrollActionForm.php - Form constructor.
File
- modules/
social_features/ social_event/ src/ Form/ EnrollActionForm.php, line 493
Class
- EnrollActionForm
- Class EnrollActionForm.
Namespace
Drupal\social_event\FormCode
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;
}