function hook_groupmedia_entity_group_alter in Group Media 8.2
Alters the list of groups entity might belong to.
Parameters
array $groups: List of groups used in groupmedia.attach_group service for given $entity. If make $groups empty array, entity will not be processed.
\Drupal\Core\Entity\EntityInterface $entity: Entity object to check.
1 function implements hook_groupmedia_entity_group_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- groupmedia_paragraphs_groupmedia_entity_group_alter in modules/
groupmedia_paragraphs/ groupmedia_paragraphs.module - Implements hook_groupmedia_entity_group_alter().
1 invocation of hook_groupmedia_entity_group_alter()
- AttachMediaToGroup::getContentGroups in src/
AttachMediaToGroup.php - Gets the groups by entity.
File
- ./
groupmedia.api.php, line 21 - Describes hooks provided by groupmedia module.
Code
function hook_groupmedia_entity_group_alter(array &$groups, EntityInterface $entity) {
if ($entity
->id() == 'foo') {
$groups[] = 'bar';
}
}