function views_natural_sort_queue_data_for_rebuild in Views Natural Sort 8.2
Views_natural_sort_queue_data_for_rebuild description.
Parameters
array $entry_types: Description.
2 calls to views_natural_sort_queue_data_for_rebuild()
- ConfigurationForm::submitFormReindexOnly in src/
Form/ ConfigurationForm.php - Submission action for the "Rebuild Index" button.
- views_natural_sort_install in ./
views_natural_sort.install - Implements hook_install().
File
- ./
views_natural_sort.module, line 149 - Contains views_natural_sort.module..
Code
function views_natural_sort_queue_data_for_rebuild(array $entry_types = []) {
$moduleHandler = \Drupal::moduleHandler();
if (empty($entry_types)) {
$entry_types = $moduleHandler
->invokeAll('views_natural_sort_get_entry_types');
}
$queues = [];
foreach ($entry_types as $entry_type) {
$queues = array_unique(array_merge($queues, array_filter($moduleHandler
->invokeAll('views_natural_sort_queue_rebuild_data', [
$entry_type,
]))));
}
$operations = [];
foreach ($queues as $queue) {
$operations[] = [
'views_natural_sort_rebuild_index',
[
$queue,
],
];
}
$batch = [
'operations' => $operations,
'title' => t('Rebuilding Views Natural Sort Indexing Entries'),
'finished' => 'views_natural_sort_finish_rebuild',
];
batch_set($batch);
}