\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)
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
$taskid | integer |
Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
$taskid | integer |
Type | Description |
---|---|
array |
Fetch(integer $taskid) : array
Returns an array of the task data for the specified taskid
Parameters
Returns
Name | Type | Description |
---|---|---|
$taskid | integer | Task ID |
Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |