PHP Class Yalesov\Cron\Service\Registry

Author: yalesov ([email protected])
Show file Open project: heartsentwined/zf2-cron Class Usage Examples

Protected Properties

Property Type Description
$cronRegistry array the actual cron registry

Public Methods

Method Description
destroy ( ) : void clear the singleton
getCronRegistry ( )
getInstance ( )
register ( string $code, string $frequency, callable $callback, array $args = [] ) : self register a cron job
setCronRegistry ( array $cronRegistry )

Private Methods

Method Description
__construct ( )

Method Details

destroy() public static method

clear the singleton
public static destroy ( ) : void
return void

getCronRegistry() public static method

public static getCronRegistry ( )

getInstance() public static method

public static getInstance ( )

register() public static method

register a cron job
See also: Cron::trySchedule() for allowed cron expression syntax
public static register ( string $code, string $frequency, callable $callback, array $args = [] ) : self
$code string the cron job code / identifier
$frequency string cron expression
$callback callable the actual cron job
$args array args to the cron job
return self

setCronRegistry() public static method

public static setCronRegistry ( array $cronRegistry )
$cronRegistry array

Property Details

$cronRegistry protected property

the actual cron registry
protected array $cronRegistry
return array