BatchOperationsService
in package
Batch Operations Service.
Manages batch update operations on objects.
Table of Contents
Methods
- __construct() : mixed
- cancelJob() : bool
- Cancel job.
- completeJob() : bool
- Complete job.
- createJob() : int
- Create a batch job.
- executeBatchUpdate() : array<string|int, mixed>
- Execute batch update.
- failJob() : bool
- Fail job.
- getJob() : object|null
- Get batch job by ID.
- getJobItems() : array<string|int, mixed>
- Get job items.
- getJobs() : array<string|int, mixed>
- Get jobs list.
- getStats() : array<string|int, mixed>
- Get job statistics.
- processItem() : array<string|int, mixed>
- Process batch item.
- startJob() : bool
- Start processing a job.
Methods
__construct()
public
__construct() : mixed
cancelJob()
Cancel job.
public
cancelJob(int $jobId) : bool
Parameters
- $jobId : int
Return values
boolcompleteJob()
Complete job.
public
completeJob(int $jobId[, array<string|int, mixed>|null $results = null ]) : bool
Parameters
- $jobId : int
- $results : array<string|int, mixed>|null = null
Return values
boolcreateJob()
Create a batch job.
public
createJob(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>
Return values
intexecuteBatchUpdate()
Execute batch update.
public
executeBatchUpdate(int $jobId, array<string|int, mixed> $updates, int $userId) : array<string|int, mixed>
Parameters
- $jobId : int
- $updates : array<string|int, mixed>
- $userId : int
Return values
array<string|int, mixed>failJob()
Fail job.
public
failJob(int $jobId, string $errorMessage) : bool
Parameters
- $jobId : int
- $errorMessage : string
Return values
boolgetJob()
Get batch job by ID.
public
getJob(int $jobId) : object|null
Parameters
- $jobId : int
Return values
object|nullgetJobItems()
Get job items.
public
getJobItems(int $jobId[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $jobId : int
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>getJobs()
Get jobs list.
public
getJobs([array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>getStats()
Get job statistics.
public
getStats() : array<string|int, mixed>
Return values
array<string|int, mixed>processItem()
Process batch item.
public
processItem(int $jobId, int $objectId, callable $processor) : array<string|int, mixed>
Parameters
- $jobId : int
- $objectId : int
- $processor : callable
Return values
array<string|int, mixed>startJob()
Start processing a job.
public
startJob(int $jobId) : bool
Parameters
- $jobId : int