batch_example_batch_1

Versions
6 – 7
batch_example_batch_1()

Batch 1 : Load 100 times the node with the lowest nid

Related topics

Code

developer/examples/batch_example.module, line 156

<?php
function batch_example_batch_1() {
  $nid = db_result(db_query_range("SELECT nid FROM {node} ORDER BY nid ASC", 0, 1));

  $operations = array();
  for ($i = 0; $i<100; $i++) {
    $operations[] = array('batch_example_op_1', array($nid));
  }
  $batch = array(
    'operations' => $operations,
    'finished' => 'batch_example_finished',
  );
  return $batch;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.