CronHandler interface for extending cron handlers.
Plenty\Modules\Cron\Contracts
Register cron jobs
Plenty\Modules\Cron\Services
public add(int $schedule, string $handlerClass):void
Use this method to add a handler class and a schedule time for your desired cron event. The action will then be triggered according to the given schedule.
int | $schedule | The number of minutes for which the cron action should be scheduled. Currently allowed are: 15, 20, 60 and 3600. You can also use constants like `CronContainer::EVERY_FIFTEEN_MINUTES`, `CronContainer::EVERY_TWENTY_MINUTES`, `CronContainer::HOURLY`, `CronContainer::DAILY`; |
string | $handlerClass | The handler class that should be triggered when the cron event is launched. This class has to extend the CronHandler interface and implement the `handle()` method. |