function gadd_group_membership_metadata in Group 7
Implements hook_group_membership_metadata().
File
- modules/
gadd/ gadd.group.inc, line 25 - Hook implementations for the Group module.
Code
function gadd_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->added_on)) {
$metadata[] = array(
'description' => t('Added on'),
'value' => format_date($emw->added_on
->value()),
);
$metadata[] = array(
'description' => t('Added by'),
'value' => l($emw->added_by
->label(), 'user/' . $group_membership->added_by),
);
}
return $metadata;
}