function farm_group_asset_membership_action in farmOS 7
Action function for farm_group_asset_membership.
Creates a new group membership observation log for the specified assets.
Parameters
array $assets: An array of asset entities to change membership of.
array $context: Array with parameters for this action.
File
- modules/
farm/ farm_group/ farm_group.module, line 452
Code
function farm_group_asset_membership_action(array $assets, $context = array()) {
// If we're missing assets, areas, or a timestamp, bail.
if (empty($assets) || empty($context['groups']) || empty($context['timestamp'])) {
drupal_set_message(t('Could not perform membership change because required information was missing.'), 'error');
return;
}
// Create a group membership observation log.
farm_group_membership_set($assets, $context['groups'], $context['timestamp'], 'farm_observation', $context['done']);
}