Creates continuous job items for entity.
Batch callback function.
function tmgmt_content_create_continuous_job_items_batch_finished($success, $results, $operations) {
if ($success) {
if ($results['job_items'] !== 0) {
\Drupal::messenger()
->addStatus(\Drupal::translation()
->formatPlural($results['job_items'], '1 continuous job item has been created.', '@count continuous job items have been created.'));
}
else {
\Drupal::messenger()
->addWarning(t('None of the selected sources can be added to continuous jobs.'));
}
}
else {
// An error occurred.
$error_operation = reset($operations);
$message = t('An error occurred while processing %error_operation with arguments: @arguments', array(
'%error_operation' => $error_operation[0],
'@arguments' => print_r($error_operation[1], TRUE),
));
\Drupal::messenger()
->addError($message);
}
}