Skip to content

Instantly share code, notes, and snippets.

@arturo-c
Last active August 29, 2015 13:58
Show Gist options
  • Save arturo-c/10420539 to your computer and use it in GitHub Desktop.
Save arturo-c/10420539 to your computer and use it in GitHub Desktop.
Get next sequential id
<?php
function get_next_sequential($nid) {
$node = node_load($nid);
foreach ($node->webform['components'] as $component) {
if ($component['type'] == 'sequential_id') {
$mid_component = $component;
}
}
return webform_sequential_id_acquire_id($mid_component);
}
$next = get_next_sequential(4194858);
drush_print('Next sequential id: ' . $next);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment