class Illuminate / Bus / PendingBatch

PendingBatch

Properties

protected

$container Container

The IoC container instance.

Default: null
public

$name string

The batch name.

Default: ''
public

$jobs Illuminate\...\Collection

The jobs that belong to the batch.

Default: null
public

$options array

The batch options.

Default: []

Methods

public

__construct ( Container $container , Illuminate\...\Collection $jobs ) : void

Create a new pending batch instance.

Parameters

  • $container Container
  • $jobs Illuminate\...\Collection
public

add ( $jobs ) : $this

Add jobs to the batch.

Parameters

  • $jobs iterable|object|array
public

then ( $callback ) : $this

Add a callback to be executed after all jobs in the batch have executed successfully.

Parameters

  • $callback callable
public

thenCallbacks ( ) : array

Get the "then" callbacks that have been registered with the pending batch.

public

catch ( $callback ) : $this

Add a callback to be executed after the first failing job in the batch.

Parameters

  • $callback callable
public

catchCallbacks ( ) : array

Get the "catch" callbacks that have been registered with the pending batch.

public

finally ( $callback ) : $this

Add a callback to be executed after the batch has finished executing.

Parameters

  • $callback callable
public

finallyCallbacks ( ) : array

Get the "finally" callbacks that have been registered with the pending batch.

public

allowFailures ( $allowFailures ) : $this

Indicate that the batch should not be cancelled when a job within the batch fails.

Parameters

  • $allowFailures bool
public

allowsFailures ( ) : bool

Determine if the pending batch allows jobs to fail without cancelling the batch.

public

name ( string $name ) : $this

Set the name for the batch.

Parameters

  • $name string
public

onConnection ( string $connection ) : $this

Specify the queue connection that the batched jobs should run on.

Parameters

  • $connection string
public

connection ( ) : string|null

Get the connection used by the pending batch.

public

onQueue ( string $queue ) : $this

Specify the queue that the batched jobs should run on.

Parameters

  • $queue string
public

queue ( ) : string|null

Get the queue used by the pending batch.

public

withOption ( string $key , $value ) : $this

Add additional data into the batch's options array.

Parameters

  • $key string
  • $value mixed
public

dispatch ( ) : Batch

Dispatch the batch.

public

dispatchAfterResponse ( ) : Batch

Dispatch the batch after the response is sent to the browser.

protected

dispatchExistingBatch ( $batch ) : void

Dispatch an existing batch.

Parameters