DatabaseBatchRepository
class DatabaseBatchRepository implements PrunableBatchRepository
Methods
Create a new batch repository instance.
Retrieve a list of batches.
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.
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 unfinished entries older than the given date.
Prune all of the cancelled entries older than the given date.
Rollback the last database transaction for the connection.
Serialize the given value.
Unserialize the given value.
Get the underlying database connection.
Details
at line 23
__construct(BatchFactory $factory, ConnectionResolverInterface $resolver, string $table, string|null $connection = null)
Create a new batch repository instance.
at line 36
array
get(int $limit = 50, mixed $before = null)
Retrieve a list of batches.
at line 52
Batch|null
find(int|string $batchId)
Retrieve information about an existing batch.
at line 65
Batch
store(PendingBatch $batch)
Store a new pending batch.
at line 94
void
incrementTotalJobs(int|string $batchId, int $amount)
Increment the total number of jobs within the batch.
at line 106
UpdatedBatchJobCounts|null
decrementPendingJobs(int|string $batchId, string $jobId)
Decrement the total number of pending jobs for the batch.
at line 125
UpdatedBatchJobCounts|null
incrementFailedJobs(int|string $batchId, string $jobId)
Increment the total number of failed jobs for the batch.
at line 144
protected array|null
updateAtomicValues(int|string $batchId, Closure $callback)
Update an atomic value within the batch.
at line 160
void
markAsFinished(int|string $batchId)
Mark the batch that has the given ID as finished.
at line 170
void
cancel(int|string $batchId)
Cancel the batch that has the given ID.
at line 181
void
delete(int|string $batchId)
Delete the batch that has the given ID.
at line 189
int
prune(DateTimeInterface $before)
Prune all of the entries older than the given date.
at line 209
int
pruneUnfinished(DateTimeInterface $before)
Prune all of the unfinished entries older than the given date.
at line 229
int
pruneCancelled(DateTimeInterface $before)
Prune all of the cancelled entries older than the given date.
at line 254
mixed
transaction(Closure $callback)
Execute the given Closure within a storage specific transaction.
at line 262
void
rollBack()
Rollback the last database transaction for the connection.
at line 270
protected string
serialize(mixed $value)
Serialize the given value.
at line 282
protected mixed
unserialize(string $serialized)
Unserialize the given value.
at line 300
protected Batch
toBatch(object $batch)
Convert the given raw batch to a Batch object.
at line 320
ConnectionInterface
getConnection()
Get the underlying database connection.