batch_example_batch_2

6 batch_example.module batch_example_batch_2()
7 batch_example.module batch_example_batch_2()
8 batch_example.module batch_example_batch_2()

Batch 2 : load all nodes 5 by 5, 20 times (Multipart operation)

Related topics

1 call to batch_example_batch_2()

File

batch_example/batch_example.module, line 185
This is an example outlining how a module can define batches.

Code

function batch_example_batch_2() {
  $operations = array();
  for ($i = 0; $i < 20; $i++) {
    $operations[] = array('batch_example_op_2', array());
  }
  $batch = array(
    'operations' => $operations, 
    'finished' => 'batch_example_finished',
    // We can define custom messages instead of the default ones. 
    'title' => t('Processing batch 2'), 
    'init_message' => t('Batch 2 is starting.'), 
    'progress_message' => t('Processed @current out of @total.'), 
    'error_message' => t('Batch 2 has encountered an error.'),
  );
  return $batch;
}
Login or register to post comments