function commerce_license_expiration_queue_process in Commerce License 7
Worker callback for expiring licenses.
2 string references to 'commerce_license_expiration_queue_process'
- commerce_license_advanced_queue_info in ./
commerce_license.module - Implements hook_advanced_queue_info().
- commerce_license_cron_queue_info in ./
commerce_license.module - Implements hook_cron_queue_info().
File
- ./
commerce_license.module, line 638 - Provides a framework for selling access to local or remote resources.
Code
function commerce_license_expiration_queue_process($item) {
// Account for differences in how the different queues process items.
$data = module_exists('advancedqueue') ? $item->data : $item;
$license = entity_load_single('commerce_license', $data['license_id']);
if ($license) {
$license
->expire();
}
if (module_exists('advancedqueue')) {
// If advancedqueue is used, return the proper status.
return array(
'status' => ADVANCEDQUEUE_STATUS_SUCCESS,
'result' => 'Processed license #' . $data['license_id'],
);
}
}