public static function RefreshBatch::createBatch in Media Thumbnails 8
Creates the batch definition.
Return value
array The batch definition.
2 calls to RefreshBatch::createBatch()
- MediaThumbnailCommands::refresh in src/
Commands/ MediaThumbnailCommands.php - Refresh the thumbnails for all media entities.
- MediaThumbnailRefreshForm::submitForm in src/
Form/ MediaThumbnailRefreshForm.php - Form submission handler.
File
- src/
Batch/ RefreshBatch.php, line 20
Class
- RefreshBatch
- Class RefreshBatch.
Namespace
Drupal\media_thumbnails\BatchCode
public static function createBatch() : array {
$ids = \Drupal::entityQuery('media')
->execute();
return [
'operations' => [
[
'\\Drupal\\media_thumbnails\\Batch\\RefreshBatch::process',
[
array_values($ids),
],
],
],
'finished' => '\\Drupal\\media_thumbnails\\Batch\\RefreshBatch::finished',
'title' => t('Refreshing media entity thumbnails'),
'init_message' => t('Thumbnail refresh batch is starting.'),
'progress_message' => t('Please wait...'),
'error_message' => t('Thumbnail refresh batch has encountered an error.'),
];
}