[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_scheduler/src/Task/ -> Task.php (summary)

(no description)

Copyright: (C) 2021 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 563 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Task:: (14 methods):
  __construct()
  getRecord()
  run()
  getContent()
  acquireLock()
  releaseLock()
  log()
  skipExecution()
  dispatchExitEvent()
  isSuccess()
  set()
  get()
  isValidState()
  isValidId()


Class: Task  - X-Ref

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)   X-Ref
Constructor for {@see Task}.

param: object  $record  A task from {@see TaskTable}.

getRecord()   X-Ref
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.

return: object

run()   X-Ref
Execute the task.

return: boolean  True if success

getContent()   X-Ref
Get the task execution snapshot.
! Access locations will need updates once a more robust Snapshot container is implemented.

return: array

acquireLock()   X-Ref
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.

return: boolean

releaseLock(bool $update = true)   X-Ref
Remove the pseudo-lock and optionally update the task record.

param: bool  $update  If true, the record is updated with the snapshot
return: boolean

log(string $message, string $priority = 'info')   X-Ref

param: string  $message   Log message
param: string  $priority  Log level, defaults to 'info'
return: void

skipExecution()   X-Ref
Advance the task entry's next calculated execution, effectively skipping the current execution.

return: void

dispatchExitEvent()   X-Ref
Handles task exit (dispatch event).

return: void

isSuccess()   X-Ref
Was the task successful?

return: boolean  True if the task was successful.

set(string $path, $value, string $separator = null)   X-Ref
Set a task property. This method is a proxy to {@see Registry::set()}.

param: string   $path       Registry path of the task property.
param: mixed    $value      The value to set to the property.
param: ?string  $separator  The key separator.
return: mixed|null

get(string $path, $default = null)   X-Ref
Get a task property. This method is a proxy to {@see Registry::get()}.

param: string  $path     Registry path of the task property.
param: mixed   $default  Default property to return, if the actual value is null.
return: mixed  The task property.

isValidState(string $state)   X-Ref
Static method to determine whether an enumerated task state (as a string) is valid.

param: string  $state  The task state (enumerated, as a string).
return: boolean

isValidId(string $id)   X-Ref
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.

param: string  $id  The task id (as a string).
return: boolean



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer