Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BatchBuilder.php

function BatchBuilder::toArray

Converts a \Drupal\Core\Batch\Batch object into an array.

Return value

array The array representation of the object.

File

core/lib/Drupal/Core/Batch/BatchBuilder.php, line 326

Class

BatchBuilder
Builds an array for a batch process.

Namespace

Drupal\Core\Batch

Code

public function toArray() {
    $array = [
        'operations' => $this->operations ?: [],
        'title' => $this->title ?: '',
        'init_message' => $this->initMessage ?: '',
        'progress_message' => $this->progressMessage ?: '',
        'error_message' => $this->errorMessage ?: '',
        'finished' => $this->finished,
        'file' => $this->file,
        'library' => $this->libraries ?: [],
        'url_options' => $this->urlOptions ?: [],
        'progressive' => $this->progressive,
    ];
    if ($this->queue) {
        $array['queue'] = $this->queue;
    }
    return $array;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal