DatabaseBatchRepository
Implements
Properties
$table string
The database table to use to store batch information.
Methods
__construct ( BatchFactory $factory , Connection $connection , string $table ) : void
Create a new batch repository instance.
Parameters
- $factory BatchFactory
- $connection Connection
- $table string
get ( $limit , $before ) : Illuminate\...\Batch[]
Retrieve a list of batches.
Parameters
- $limit int
- $before mixed
find ( string $batchId ) : Batch |null
Retrieve information about an existing batch.
Parameters
- $batchId string
store ( PendingBatch $batch ) : Batch
Store a new pending batch.
Parameters
- $batch PendingBatch
incrementTotalJobs ( string $batchId , int $amount ) : void
Increment the total number of jobs within the batch.
Parameters
- $batchId string
- $amount int
decrementPendingJobs ( string $batchId , string $jobId ) : UpdatedBatchJobCounts
Decrement the total number of pending jobs for the batch.
Parameters
- $batchId string
- $jobId string
incrementFailedJobs ( string $batchId , string $jobId ) : UpdatedBatchJobCounts
Increment the total number of failed jobs for the batch.
Parameters
- $batchId string
- $jobId string
updateAtomicValues ( string $batchId , Closure $callback ) : int|null
Update an atomic value within the batch.
Parameters
- $batchId string
- $callback Closure
markAsFinished ( string $batchId ) : void
Mark the batch that has the given ID as finished.
Parameters
- $batchId string
cancel ( string $batchId ) : void
Cancel the batch that has the given ID.
Parameters
- $batchId string
delete ( string $batchId ) : void
Delete the batch that has the given ID.
Parameters
- $batchId string
prune ( DateTimeInterface $before ) : int
Prune all of the entries older than the given date.
Parameters
- $before DateTimeInterface
pruneUnfinished ( DateTimeInterface $before ) : int
Prune all of the unfinished entries older than the given date.
Parameters
- $before DateTimeInterface
pruneCancelled ( DateTimeInterface $before ) : int
Prune all of the cancelled entries older than the given date.
Parameters
- $before DateTimeInterface
transaction ( Closure $callback ) : mixed
Execute the given Closure within a storage specific transaction.
Parameters
- $callback Closure
serialize ( $value ) : string
Serialize the given value.
Parameters
- $value mixed
unserialize ( $serialized ) : mixed
Unserialize the given value.
Parameters
- $serialized string
toBatch ( $batch ) : Batch
Convert the given raw batch to a Batch object.
Parameters
- $batch object
setConnection ( Connection $connection ) : void
Set the underlying database connection.
Parameters
- $connection Connection