Job
What is a job?
A job is the class that is responsible for what your code is doing.
This is the class you will have to create (or reuse), as it contains the business logic required for what you wish to achieve.
How to create a job?
<?php
use Yokai\Batch\JobExecution;
use Yokai\Batch\Job\JobInterface;
class DoStuffJob implements JobInterface
{
public function execute(JobExecution $jobExecution): void
{
// you stuff here
}
}
The only requirement is implementing JobInterface,
What types of job exists?
Built-in jobs:
AbstractDecoratedJob: a job that is designed to be extended, helps job construction.
ItemJob: ETL like, batch processing job (documentation).
JobWithChildJobs: a job that trigger other jobs (documentation).
TriggerScheduledJobsJob: a job that trigger other jobs when schedule is due (todo documentation).
Jobs from bridges:
From
league/flysystem
bridge:CopyFilesJob: copy files from one filesystem to another.
MoveFilesJob: move files from one filesystem to another.