PHP Class Habari\CronTab

Show file Open project: habari/system Class Usage Examples

Public Methods

Method Description
add_cron ( array $paramarray ) : CronJob Add a new cron job to the DB.
add_daily_cron ( string $name, mixed $callback, string $description = '' ) : CronJob Add a new cron job to the DB, that runs daily.
add_hourly_cron ( string $name, mixed $callback, string $description = '' ) : CronJob Add a new cron job to the DB, that runs hourly.
add_monthly_cron ( string $name, mixed $callback, string $description = '' ) : CronJob Add a new cron job to the DB, that runs monthly.
add_single_cron ( string $name, mixed $callback, DateTime $run_time, string $description = '' ) : CronJob Add a new cron job to the DB, that runs only once.
add_weekly_cron ( string $name, mixed $callback, string $description = '' ) : CronJob Add a new cron job to the DB, that runs weekly.
delete_cronjob ( mixed $name ) : boolean Delete a Cron Job by name or id from the Database.
get_cronjob ( mixed $name ) : CronJob Get a Cron Job by name or id from the Database.

Method Details

add_cron() static public method

Add a new cron job to the DB.
See also: CronJob
static public add_cron ( array $paramarray ) : CronJob
$paramarray array A paramarray of cron job feilds.
return CronJob

add_daily_cron() static public method

Add a new cron job to the DB, that runs daily.
static public add_daily_cron ( string $name, mixed $callback, string $description = '' ) : CronJob
$name string The name of the cron job.
$callback mixed The callback function or plugin action for the cron job to execute.
$description string The description of the cron job.
return CronJob

add_hourly_cron() static public method

Add a new cron job to the DB, that runs hourly.
static public add_hourly_cron ( string $name, mixed $callback, string $description = '' ) : CronJob
$name string The name of the cron job.
$callback mixed The callback function or plugin action for the cron job to execute.
$description string The description of the cron job.
return CronJob

add_monthly_cron() static public method

Add a new cron job to the DB, that runs monthly.
static public add_monthly_cron ( string $name, mixed $callback, string $description = '' ) : CronJob
$name string The name of the cron job.
$callback mixed The callback function or plugin action for the cron job to execute.
$description string The description of the cron job.
return CronJob

add_single_cron() static public method

Add a new cron job to the DB, that runs only once.
static public add_single_cron ( string $name, mixed $callback, DateTime $run_time, string $description = '' ) : CronJob
$name string The name of the cron job.
$callback mixed The callback function or plugin action for the cron job to execute.
$run_time DateTime The time to execute the cron.
$description string The description of the cron job.
return CronJob

add_weekly_cron() static public method

Add a new cron job to the DB, that runs weekly.
static public add_weekly_cron ( string $name, mixed $callback, string $description = '' ) : CronJob
$name string The name of the cron job.
$callback mixed The callback function or plugin action for the cron job to execute.
$description string The description of the cron job.
return CronJob

delete_cronjob() static public method

Delete a Cron Job by name or id from the Database.
static public delete_cronjob ( mixed $name ) : boolean
$name mixed The name or id of the cron job to delete.
return boolean Wheather or not the delete was successfull

get_cronjob() static public method

Get a Cron Job by name or id from the Database.
static public get_cronjob ( mixed $name ) : CronJob
$name mixed The name or id of the cron job to retreive.
return CronJob The cron job retreived from the DB