Plentymarkets interface documentation

Cron

Contracts

CronHandler

CronHandler interface for extending cron handlers.

Namespace

Plenty\Modules\Cron\Contracts

Services

CronContainer

Register cron jobs

Namespace

Plenty\Modules\Cron\Services

Methods
public add($schedule, $handlerClass, $position):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.

Parameters

Name

Type

Description

$schedule

int

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;

$handlerClass

string

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.

$position

int