You are here

function birthdays_set_batch in Birthdays 6

Set the batch for either synchronisation processes.

2 calls to birthdays_set_batch()
birthdays_sync_birthdays_to_profiles in ./birthdays.sync.inc
Birthdays to Profile submit handler.
birthdays_sync_profiles_to_birthdays in ./birthdays.sync.inc
Profile to Birthdays submit handler.

File

./birthdays.sync.inc, line 75
Because the Birthdays module uses 2 tables for the birthdays, they have to be kept in sync with each other. Normally that will be no problem, but in some cases there is the need to manually synchronize the two tables. These cases are for example:

Code

function birthdays_set_batch($title, $operation_callback) {
  global $_birthdays_field;
  $batch = array(
    'title' => $title,
    'operations' => array(
      array(
        $operation_callback,
        array(
          $_birthdays_field,
        ),
      ),
    ),
    'finished' => 'batch_birthdays_sync_finished',
    'init_message' => t('Synchronization is starting.'),
    'progress_message' => t('Synchronizing'),
    'file' => drupal_get_path('module', 'birthdays') . '/birthdays.sync.inc',
  );

  // Set the batch. It will start immediately, because it is called from a
  // submit handler.
  batch_set($batch);
}