class Illuminate / Bus / DatabaseBatchRepository
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

DatabaseBatchRepository

Implements

Properties

protected

$factory BatchFactory

The batch factory instance.

Default: null
protected

$connection Connection

The database connection instance.

Default: null
protected

$table string

The database table to use to store batch information.

Default: null

Methods

public

__construct ( BatchFactory $factory , Connection $connection , string $table ) : void

Create a new batch repository instance.

Parameters

public

get ( $limit , $before ) : Illuminate\...\Batch[]

Retrieve a list of batches.

Parameters

  • $limit int
  • $before mixed
public

find ( string $batchId ) : Batch |null

Retrieve information about an existing batch.

Parameters

  • $batchId string
public

store ( PendingBatch $batch ) : Batch

Store a new pending batch.

Parameters

public

incrementTotalJobs ( string $batchId , int $amount ) : void

Increment the total number of jobs within the batch.

Parameters

  • $batchId string
  • $amount int
public

decrementPendingJobs ( string $batchId , string $jobId ) : UpdatedBatchJobCounts

Decrement the total number of pending jobs for the batch.

Parameters

  • $batchId string
  • $jobId string
public

incrementFailedJobs ( string $batchId , string $jobId ) : UpdatedBatchJobCounts

Increment the total number of failed jobs for the batch.

Parameters

  • $batchId string
  • $jobId string
protected

updateAtomicValues ( string $batchId , Closure $callback ) : int|null

Update an atomic value within the batch.

Parameters

public

markAsFinished ( string $batchId ) : void

Mark the batch that has the given ID as finished.

Parameters

  • $batchId string
public

cancel ( string $batchId ) : void

Cancel the batch that has the given ID.

Parameters

  • $batchId string
public

delete ( string $batchId ) : void

Delete the batch that has the given ID.

Parameters

  • $batchId string
public

prune ( DateTimeInterface $before ) : int

Prune all of the entries older than the given date.

Parameters

public

pruneUnfinished ( DateTimeInterface $before ) : int

Prune all of the unfinished entries older than the given date.

Parameters

public

pruneCancelled ( DateTimeInterface $before ) : int

Prune all of the cancelled entries older than the given date.

Parameters

public

transaction ( Closure $callback ) : mixed

Execute the given Closure within a storage specific transaction.

Parameters

protected

serialize ( $value ) : string

Serialize the given value.

Parameters

  • $value mixed
protected

unserialize ( $serialized ) : mixed

Unserialize the given value.

Parameters

  • $serialized string
protected

toBatch ( $batch ) : Batch

Convert the given raw batch to a Batch object.

Parameters

  • $batch object
public

getConnection ( ) : Connection

Get the underlying database connection.

public

setConnection ( Connection $connection ) : void

Set the underlying database connection.

Parameters