devel_generate.batch.inc

Same filename in other branches
  1. 4.x devel_generate/devel_generate.batch.inc
  2. 5.x devel_generate/devel_generate.batch.inc

File

devel_generate/devel_generate.batch.inc

View source
<?php


/**
 * Wrapping function for invoking the right
 * method responsible for handle a given batch operation.
 * Available for every DevelGeneratePlugin.
 */
function devel_generate_operation(Drupal\devel_generate\DevelGenerateBaseInterface $class, $method, $vars, &$context) {
    return $class->{$method}($vars, $context);
}

/**
 * Common finish batch function available for
 * every DevelGeneratePlugin.
 */
function devel_generate_batch_finished($success, $results, $operations) {
    if ($success) {
        $message = t('Finished @num elements created successfully.', array(
            '@num' => $results['num'],
        ));
    }
    else {
        $message = t('Finished with an error.');
    }
    drupal_set_message($message);
}

Functions

Title Deprecated Summary
devel_generate_batch_finished Common finish batch function available for every DevelGeneratePlugin.
devel_generate_operation Wrapping function for invoking the right method responsible for handle a given batch operation. Available for every DevelGeneratePlugin.