Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct (object $record) | |
getRecord () | |
getContent () | |
acquireLock () | |
releaseLock (bool $update=true) | |
log (string $message, string $priority='info') | |
skipExecution () | |
isSuccess () | |
get (string $path, $default=null) | |
Fonctions membres publiques hérités de LoggerAwareInterface | |
setLogger (LoggerInterface $logger) | |
Fonctions membres publiques statiques | |
static | isValidState (string $state) |
static | isValidId (string $id) |
Champs de données | |
const | STATE_ENABLED = 1 |
const | STATE_DISABLED = 0 |
const | STATE_TRASHED = -2 |
const | STATE_MAP |
$logCategory | |
Fonctions membres protégées | |
dispatchExitEvent () | |
set (string $path, $value, string $separator=null) | |
Attributs protégés | |
$snapshot = [] | |
$taskRegistry | |
$app | |
$db | |
const | EVENTS_MAP |
The Task class defines methods for the execution, logging and related properties of Tasks as supported by com_scheduler
, a Task Scheduling component.
__construct | ( | object | $record | ) |
Constructor for {
object | $record | A task from { |
Références $options, Log\addLogger(), Log\ALL, class, Log\createDelegatedLogger(), Factory\getApplication(), Factory\getContainer(), et Psr\Log\setLogger().
acquireLock | ( | ) |
Acquire a pseudo-lock on the task record. ! At the moment, this method is not used anywhere as task locks are already acquired when they're fetched. As such this method is not functional and should not be reviewed until it is updated.
Références $db, $id, $now, $query, Factory\getDate(), ComponentHelper\getParams(), et ParameterType\INTEGER.
|
protected |
Handles task exit (dispatch event).
Références $this, et AbstractEvent\create().
get | ( | string | $path, |
$default = null |
|||
) |
Get a task property. This method is a proxy to {
string | $path | Registry path of the task property. |
mixed | $default | Default property to return, if the actual value is null. |
getContent | ( | ) |
Get the task execution snapshot. ! Access locations will need updates once a more robust Snapshot container is implemented.
getRecord | ( | ) |
Get the task as a data object that can be stored back in the database. ! This method should be removed or changed as part of a better API implementation for the driver.
isSuccess | ( | ) |
Was the task successful?
Références null, Status\OK, et Status\WILL_RESUME.
|
static |
Static method to determine whether a task id is valid. Note that this does not validate ids against the database, but only verifies that an id may exist.
string | $id | The task id (as a string). |
Références $id.
|
static |
Static method to determine whether an enumerated task state (as a string) is valid.
string | $state | The task state (enumerated, as a string). |
Références $state, ArrayHelper\getValue(), et null.
log | ( | string | $message, |
string | $priority = 'info' |
||
) |
string | $message | Log message |
string | $priority | Log level, defaults to 'info' |
InvalidArgumentException |
Références $message.
releaseLock | ( | bool | $update = true | ) |
Remove the pseudo-lock and optionally update the task record.
bool | $update | If true, the record is updated with the snapshot |
Références $db, $id, $query, ParameterType\INTEGER, et null.
|
protected |
Set a task property. This method is a proxy to {
string | $path | Registry path of the task property. |
mixed | $value | The value to set to the property. |
?string | $separator The key separator. |
Références $path, $separator, et $value.
skipExecution | ( | ) |
|
protected |
|
protected |
$logCategory |
|
protected |
|
protected |
|
protected |
const STATE_DISABLED = 0 |
Enumerated state for disabled tasks.
const STATE_ENABLED = 1 |
Enumerated state for enabled tasks.
const STATE_MAP |
Map state enumerations to logical language adjectives.
const STATE_TRASHED = -2 |
Enumerated state for trashed tasks.