function acquia_lift_sync_item in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 acquia_lift.module \acquia_lift_sync_item()
Queue callback function for making a request to Acquia Lift.
Parameters
$item: The queue item to process. It should be an array with the following keys:
- method The method to call on the AcquiaLiftAPI instance
- args The args to pass to the method.
1 call to acquia_lift_sync_item()
- acquia_lift_batch_sync_item in ./
acquia_lift.module - Wrapper function around acquia_lift_sync_item that catches and logs exceptions thrown.
1 string reference to 'acquia_lift_sync_item'
- acquia_lift_cron_queue_info in ./
acquia_lift.module - Implements hook_cron_queue_info().
File
- ./
acquia_lift.module, line 969 - acquia_lift.module Provides Acquia Lift-specific personalization functionality.
Code
function acquia_lift_sync_item($item) {
// The item is either a method to be called on the LiftAPI class or a regular
// function.
// @todo This conditional is a bit gross, figure out a way to handle the different types
// of callables better.
if (isset($item['method'])) {
$acquia_lift_api = AcquiaLiftAPI::getInstance(variable_get('acquia_lift_account_info', array()));
call_user_func_array(array(
$acquia_lift_api,
$item['method'],
), $item['args']);
}
else {
call_user_func_array($item['callback'], $item['args']);
}
}