You are here

function ginvite_group_membership_metadata in Group 7

Implements hook_group_membership_metadata().

File

modules/ginvite/ginvite.group.inc, line 34
Hook implementations for the Group module.

Code

function ginvite_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->invited_on)) {
    $metadata[] = array(
      'description' => t('Invited on'),
      'value' => format_date($emw->invited_on
        ->value()),
    );
    $metadata[] = array(
      'description' => t('Invited by'),
      'value' => l($emw->invited_by
        ->label(), 'user/' . $group_membership->invited_by),
    );
  }
  return $metadata;
}