You are here

public function BulkUpdateFieldsForm::updateFields in Bulk Update Fields 8

Same name and namespace in other branches
  1. 8.2 src/Form/BulkUpdateFieldsForm.php \Drupal\bulk_update_fields\Form\BulkUpdateFieldsForm::updateFields()
1 call to BulkUpdateFieldsForm::updateFields()
BulkUpdateFieldsForm::submitForm in src/Form/BulkUpdateFieldsForm.php
Form submission handler.

File

src/Form/BulkUpdateFieldsForm.php, line 102

Class

BulkUpdateFieldsForm
BulkUpdateFieldsForm.

Namespace

Drupal\bulk_update_fields\Form

Code

public function updateFields() {
  $entities = $this->userInput['entities'];
  $fields = $this->userInput['fields'];
  $batch = [
    'title' => $this
      ->t('Updating Fields...'),
    'operations' => [
      [
        '\\Drupal\\bulk_update_fields\\BulkUpdateFields::updateFields',
        [
          $entities,
          $fields,
        ],
      ],
    ],
    'finished' => '\\Drupal\\bulk_update_fields\\BulkUpdateFields::bulkUpdateFieldsFinishedCallback',
  ];
  batch_set($batch);
  return 'All fields were updated successfully';
}