CronJob View code

Extends \CMSMS\Async\Job Implements \CMSMS\Async\CronJobInterface

An abstract base class for a cronjob.

A Cron job is different than a regular job in that it recurs at a specified frequency and can have an end/until date.

package

CMS

author

Robert Campbell

copyright

Copyright (c) 2016, Robert Campbell calguy1000@cmsmadesimple.org

since 2.2

Methods

__construct() 

Constructor.

inherited
delete() 

Delete this job from the database.

inherited

This method will throw exceptions if the job manager module is not available, or if for some reason the job could not be removed.

save() 

Save this job to the database.

inherited

This method will throw exceptions if the job manager module is not available, or if for some reason the job could not be saved.

execute() 

Abstract function to execute the job.

inherited abstract

Note: all jobs should be able to execute properly within one HTTP request. Jobs cannot count on administrator or data stored in session variables. Any data that is needed for the job to process should either be stored with the job object, or stored in the database in a user-independant format.

Properties

name

name : string
inherited

The name of this job. If not specified a unique random name will be generated.

Type(s)

string

module

module : string
inherited

The module that created this job. Useful if the job ever needs to be deleted.

Type(s)

string

start

start : integer
inherited

The minimum time that this job should start at.

Type(s)

integer

id

id : integer
inherited

A unique integer id for this job (generated on save).

Type(s)

integer

created

created : integer
inherited

The unix timestamp that this job was first created.

Type(s)

integer

errors

errors : integer
inherited

The number of errors encountered while trying to pricess this job.

Type(s)

integer