You are here

function ggroup_group_membership_metadata in Group 7

Implements hook_group_membership_metadata().

File

modules/ggroup/ggroup.group.inc, line 29
Hook implementations for the Group module.

Code

function ggroup_group_membership_metadata(GroupMembership $group_membership) {
  $metadata = array();

  // Create an EMW to have easy access to the data we need.
  $emw = entity_metadata_wrapper('group_membership', $group_membership);
  if (!empty($group_membership->parent_mid)) {
    $parent = $emw->parent_membership->group
      ->value();
    $metadata[] = array(
      'description' => t('Inherited from'),
      'value' => l($parent
        ->label(), 'group/' . $parent->gid),
    );
  }
  return $metadata;
}