Tasks

API Documentation

\GSPPanel\Tasks

This class allows interaction with tasks, commonly used for processes that take a while.

Methods

Create(array $params) : integer

Create a task

This function simply creates a record in the tasklist and responds with the taskid to use

$params requires the following:

  • type: The type of task
  • ugid: The users game id (optional)
  • data: an array of data for the task (optional)
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
integer
Delete(integer $taskid) : array

Deletes the task from the database

Returns the following:

  • error
    • -1 - No taskid provided
    • -2 - Task not found
    • 0 - Task deleted
Parameters
NameTypeDescription
$taskidinteger
Returns
TypeDescription
array
End(integer $taskid) : array

Sets/Updates the finished time for the task

Returns the following:

  • error
    • -1 - No taskid provided
    • -2 - Task not found
    • 0 - Task finsihed
Parameters
NameTypeDescription
$taskidinteger
Returns
TypeDescription
array
Fetch(integer $taskid) : array

Returns an array of the task data for the specified taskid

Parameters
NameTypeDescription
$taskidinteger

Task ID

Returns
TypeDescription
array
Update(array $params) : array

This updates the data in the specified task

$params requires the following:

  • taskid: The task's id (REQUIRED)
  • ugid: The users game id
  • type: The type of task
  • data: An array of data to be added
  • rewriteold: Should the old data be replaced or should this be appended (true/false)

Returns the following:

  • error
    • -1 - No taskid provided
    • -2 - Task not found
    • 0 - Task updated
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
array
UpdateResults(array $params) : array

This updates the results for the task

$params requires the following:

  • taskid: The task's id (REQUIRED)
  • results: Text to add
  • rewriteold: Should the old results be replaced or should this be appended (true/false)

Returns the following:

  • error
    • -1 - No taskid provided
    • -2 - Task not found
    • 0 - Task updated
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
array
Documentation was generated by phpDocumentor 2.9.0.