Class cfTaskSnippets
cfTaskSnippets Class
Class to create, manage and use task snippets.
Package: clearFusionCMS
Copyright:
Copyright (c) 2012 - 2013 clearFusionCMS. All rights reserved.
Located at system/app/cfTaskSnippets.php
Methods summary
public
|
#
__construct( flDb $db )
Create the object.
Parameters
|
public
integer
|
#
getCount( integer $catId = null )
Get the count of tasks.
Parameters
- $catId
- If given is limits the count to a category.
Returns
integer The number of custom fields.
|
public
array
|
#
getInCat( integer $catId )
Get the list of tasks that are in a category.
Get the list of tasks that are in a category.
Parameters
Returns
array Array of tasks in the category.
|
public
|
#
categoryDeleted( integer $catId )
Moves all tasks from the deleted category to the root.
Moves all tasks from the deleted category to the root.
Parameters
- $catId
- ID of the category being deleted.
|
public
array
|
#
getTask( integer $id )
Get the data for a task.
Parameters
- $id
- ID of the snippet to get.
Returns
array Assosiative array of data or false if failed to read.
|
public
string
|
#
mapRateToEvent( integer $rate )
Map the task rate to a system cron event.
Map the task rate to a system cron event.
Parameters
Returns
string The event to use.
|
public
integer
|
#
createTask( string $name, string $description, string $content, string $catId, integer $rate, string $email )
Create a task.
Parameters
- $name
- The name of the task.
- $description
- The description of the task.
- $content
- The content of the task.
- $catId
- The category to add the element to.
- $rate
- The rate to run the task at in seconds.
- $email
- Optional email address.
Returns
integer ID of the new task; or false if failed.
|
public
boolean
|
#
updateTask( integer $id, string $name, string $description, string $content, string $catId, integer $rate, string $email )
Update a task.
Parameters
- $id
- The id of the task to update.
- $name
- The name of the task.
- $description
- The description of the task.
- $content
- The content of the task.
- $catId
- The category to add the element to.
- $rate
- The rate to run the task at in seconds.
- $email
- Optional email address.
Returns
boolean true if worked; else false.
|
public
boolean
|
#
deleteTask( integer $id )
Delete a task.
Parameters
- $id
- The id of the task to delete.
Returns
boolean true if worked; else false.
|
public
|
#
runTask( string $name )
Run the named task.
Parameters
- $name
- The name of the task to run.
|