Cronjob

Implements \CronjobInterface

Class Cronjob

package

Default

Methods

Cronjob constructor.

__construct(\StringType $name, \StringType $title, \CronjobConfigurationCollection $configuration) 

Arguments

$name

\StringType

Name of cronjob.

$title

\StringType

Cronjob's title.

$configuration

\CronjobConfigurationCollection

Configurations of cronjob.

Converts a "CamelCaseString" into a "snake_case_string".

_camelCase2Snake(string $input) : string

Arguments

$input

string

Value to be formatted.

Response

string

Snake case string of $input.

Returns the DateTime that is contained in a given file.

_getDateTimeFromFlagFile(\StringType $flagPath) : \DateTime

Arguments

$flagPath

\StringType

Response

\DateTime

Returns the DateTime of the last run.

_getLastRunDate(\ExistingDirectory $cache) : \DateTime

Arguments

$cache

\ExistingDirectory

Absolute path to cache directory.

Response

\DateTime

Returns the DateTime of the last successful run.

_getLastSuccessDate(\ExistingDirectory $cache) : \DateTime

Arguments

$cache

\ExistingDirectory

Absolute path to cache directory.

Response

\DateTime

Returns if the last run was successful.

_isLastRunSuccessful(\ExistingDirectory $cache) : boolean

Arguments

$cache

\ExistingDirectory

Absolute path to cache directory.

Response

boolean

Returns whether the task was executed yet or not

_isTaskNotExecutedYet( $cache) : boolean

Arguments

$cache

\ExistingDirectory $cache Absolute path to cache directory.

Response

boolean

Returns the cronjob configuration.

getConfiguration() : \CronjobConfigurationCollection

Returns the cronjob interval.

getInterval() : string

Response

string

Returns the cronjob log.

getLog(\ExistingDirectory $logDir) : string
Throws
\CronjobLogFileNotFoundException

If no cronjob log file was found.

Arguments

$logDir

\ExistingDirectory

Absolute path to log files directory.

Response

string

Returns the cronjob name.

getName() : string

Response

string

Returns the cronjob status.

getStatus(\ExistingDirectory $cache) : string

Arguments

$cache

\ExistingDirectory

Absolute path to cache directory.

Response

string

Returns the cronjob title.

getTitle() : string

Response

string

Returns the cronjob data as array.

toArray(\ExistingDirectory $cacheDir) : array

Arguments

$cacheDir

\ExistingDirectory

Response

array

Properties

name

name : string
var

Type(s)

string

title

title : string
var

Type(s)

string

configuration

configuration : \CronjobConfigurationCollection

settings

settings : \CronjobSettings
var

Type(s)

\CronjobSettings