Cronjob
in package
implements
CronjobInterface
Class Cronjob
Interfaces, Classes and Traits
- CronjobInterface
- Interface CronjobInterface
Table of Contents
- $configuration : CronjobConfigurationCollection
- $name : string
- $settings : CronjobSettings
- $title : string
- __construct() : mixed
- Cronjob constructor.
- getConfiguration() : CronjobConfigurationCollection
- Returns the cronjob configuration.
- getInterval() : string
- Returns the cronjob interval.
- getLog() : string
- Returns the cronjob log.
- getName() : string
- Returns the cronjob name.
- getStatus() : string
- Returns the cronjob status.
- getTitle() : string
- Returns the cronjob title.
- toArray() : array<string|int, mixed>
- Returns the cronjob data as array.
- _camelCase2Snake() : string
- Converts a "CamelCaseString" into a "snake_case_string".
- _getDateTimeFromFlagFile() : DateTime
- Returns the DateTime that is contained in a given file.
- _getLastRunDate() : DateTime
- Returns the DateTime of the last run.
- _getLastSuccessDate() : DateTime
- Returns the DateTime of the last successful run.
- _isLastRunSuccessful() : bool
- Returns if the last run was successful.
- _isTaskNotExecutedYet() : bool
- Returns whether the task was executed yet or not
Properties
$configuration
protected
CronjobConfigurationCollection
$configuration
$name
protected
string
$name
$settings
protected
CronjobSettings
$settings
$title
protected
string
$title
Methods
__construct()
Cronjob constructor.
public
__construct(StringType $name, StringType $title, CronjobConfigurationCollection $configuration) : mixed
Parameters
- $name : StringType
-
Name of cronjob.
- $title : StringType
-
Cronjob's title.
- $configuration : CronjobConfigurationCollection
-
Configurations of cronjob.
Return values
mixed —getConfiguration()
Returns the cronjob configuration.
public
getConfiguration() : CronjobConfigurationCollection
Return values
CronjobConfigurationCollection —getInterval()
Returns the cronjob interval.
public
getInterval() : string
Return values
string —getLog()
Returns the cronjob log.
public
getLog(ExistingDirectory $logDir) : string
Parameters
- $logDir : ExistingDirectory
-
Absolute path to log files directory.
Tags
Return values
string —getName()
Returns the cronjob name.
public
getName() : string
Return values
string —getStatus()
Returns the cronjob status.
public
getStatus(ExistingDirectory $cache) : string
Parameters
- $cache : ExistingDirectory
-
Absolute path to cache directory.
Return values
string —getTitle()
Returns the cronjob title.
public
getTitle() : string
Return values
string —toArray()
Returns the cronjob data as array.
public
toArray(ExistingDirectory $cacheDir) : array<string|int, mixed>
Parameters
- $cacheDir : ExistingDirectory
Return values
array<string|int, mixed> —_camelCase2Snake()
Converts a "CamelCaseString" into a "snake_case_string".
protected
_camelCase2Snake(string $input) : string
Parameters
- $input : string
-
Value to be formatted.
Return values
string —Snake case string of $input.
_getDateTimeFromFlagFile()
Returns the DateTime that is contained in a given file.
protected
_getDateTimeFromFlagFile(StringType $flagPath) : DateTime
Parameters
- $flagPath : StringType
Return values
DateTime —_getLastRunDate()
Returns the DateTime of the last run.
protected
_getLastRunDate(ExistingDirectory $cache) : DateTime
Parameters
- $cache : ExistingDirectory
-
Absolute path to cache directory.
Return values
DateTime —_getLastSuccessDate()
Returns the DateTime of the last successful run.
protected
_getLastSuccessDate(ExistingDirectory $cache) : DateTime
Parameters
- $cache : ExistingDirectory
-
Absolute path to cache directory.
Return values
DateTime —_isLastRunSuccessful()
Returns if the last run was successful.
protected
_isLastRunSuccessful(ExistingDirectory $cache) : bool
Parameters
- $cache : ExistingDirectory
-
Absolute path to cache directory.
Return values
bool —_isTaskNotExecutedYet()
Returns whether the task was executed yet or not
protected
_isTaskNotExecutedYet( $cache) : bool