class DatabaseBatchRepository implements PrunableBatchRepository (View source)
| protected BatchFactory | $factory | The batch factory instance. | |
| protected Connection | $connection | The database connection instance. | |
| protected string | $table | The database table to use to store batch information. |
| __construct(BatchFactory $factory, Connection $connection, string $table)
Create a new batch repository instance. | ||
| Batch[] | get(int $limit = 50, mixed $before = null)
Retrieve a list of batches. | |
| Batch|null | find(string $batchId)
Retrieve information about an existing batch. | |
| Batch | store(PendingBatch $batch)
Store a new pending batch. | |
| void | incrementTotalJobs(string $batchId, int $amount)
Increment the total number of jobs within the batch. | |
| UpdatedBatchJobCounts | decrementPendingJobs(string $batchId, string $jobId)
Decrement the total number of pending jobs for the batch. | |
| UpdatedBatchJobCounts | incrementFailedJobs(string $batchId, string $jobId)
Increment the total number of failed jobs for the batch. | |
| int|null | updateAtomicValues(string $batchId, Closure $callback)
Update an atomic value within the batch. | |
| void | markAsFinished(string $batchId)
Mark the batch that has the given ID as finished. | |
| void | cancel(string $batchId)
Cancel the batch that has the given ID. | |
| void | delete(string $batchId)
Delete the batch that has the given ID. | |
| int | prune(DateTimeInterface $before)
Prune all of the entries older than the given date. | |
| int | pruneUnfinished(DateTimeInterface $before)
Prune all of the unfinished entries older than the given date. | |
| int | pruneCancelled(DateTimeInterface $before)
Prune all of the cancelled entries older than the given date. | |
| mixed | transaction(Closure $callback)
Execute the given Closure within a storage specific transaction. | |
| void | rollBack()
Rollback the last database transaction for the connection. | |
| string | serialize(mixed $value)
Serialize the given value. | |
| mixed | unserialize(string $serialized)
Unserialize the given value. | |
| Batch | toBatch(object $batch)
Convert the given raw batch to a Batch object. | |
| Connection | getConnection()
Get the underlying database connection. | |
| void | setConnection(Connection $connection)
Set the underlying database connection. |
Create a new batch repository instance.
Retrieve a list of batches.
Retrieve information about an existing batch.
Store a new pending batch.
Increment the total number of jobs within the batch.
Decrement the total number of pending jobs for the batch.
Increment the total number of failed jobs for the batch.
Update an atomic value within the batch.
Mark the batch that has the given ID as finished.
Cancel the batch that has the given ID.
Delete the batch that has the given ID.
Prune all of the entries older than the given date.
Prune all of the unfinished entries older than the given date.
Prune all of the cancelled entries older than the given date.
Execute the given Closure within a storage specific transaction.
Rollback the last database transaction for the connection.
Serialize the given value.
Unserialize the given value.
Convert the given raw batch to a Batch object.
Get the underlying database connection.
Set the underlying database connection.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Bus/DatabaseBatchRepository.html