function _batch_test_callback_6

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc \_batch_test_callback_6()
  2. 8.9.x core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc \_batch_test_callback_6()
  3. 10 core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc \_batch_test_callback_6()

Implements callback_batch_operation().

Performs a simple batch operation.

1 string reference to '_batch_test_callback_6'
_batch_test_batch_6 in core/modules/system/tests/modules/batch_test/batch_test.module
Batch 6: Repeats a simple operation.

File

core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc, line 82

Code

function _batch_test_callback_6($id, $sleep, &$context) {
    // No-op, but ensure the batch takes a couple iterations.
    // Batch needs time to run for the test, so sleep a bit.
    usleep($sleep);
    // Track execution, and store some result for post-processing in the
    // 'finished' callback.
    batch_test_stack("op 6 id {$id}");
    $context['results'][6][] = $id;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.