You are here

function batch_example_op_1 in Examples for Developers 6

Same name and namespace in other branches
  1. 8 batch_example/batch_example.module \batch_example_op_1()
  2. 7 batch_example/batch_example.module \batch_example_op_1()
  3. 3.x modules/batch_example/batch_example.module \batch_example_op_1()

Batch operation for batch 1 : load a node...

Related topics

1 string reference to 'batch_example_op_1'
batch_example_batch_1 in batch_example/batch_example.module
Batch 1 : Load 100 times the node with the lowest nid

File

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

Code

function batch_example_op_1($nid, &$context) {
  $node = node_load($nid, NULL, TRUE);

  // Store some result for post-processing in the finished callback.
  $context['results'][] = $node->nid . ' : ' . check_plain($node->title);

  // Optional message displayed under the progressbar.
  $context['message'] = t('Loading @title', array(
    '@title' => $node->title,
  ));
}