Class CronTasks
	
	
		- 
			Model
			
			
			
		
- 
			 AppModel AppModel
- 
			 CronTasks CronTasks
Methods summary
		
		
			| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Initialize Cron Tasks Overrides | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $id )
				
Retrieves a cron task Parameters
						$idinteger$id The cron task ID
Returns
						mixedAn stdClass object representing the cron task, or false if it does not exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getByKey( string $key, string $plugin_dir = null )
				
Retrieves a cron task Parameters
						$keystring$key The cron task key
$plugin_dirstring$plugin_dir The plugin directory of the plugin this cron task belongs to
Returns
						mixedAn stdClass object representing the cron task, or false if it does not exist
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAll( )
				
Retrieves a list of all cron tasks in the system 
				
Retrieves a list of all cron tasks in the system Returns
						arrayAn array of stdClass objects representing each cron task
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			add( array $vars )
				
Adds a new cron task Parameters
						$varsarray$vars An array of key=>value fields including: - key A unique key
representing this cron task - plugin_dir The plugin directory of the plugin this
cron task belongs to (optional) - name The name of this cron task - description
The description of this cron task (optional) - is_lang 1 if name and description
are language definitions in the language file, 0 otherwise (optional, default 0)
- type The type of cron task this is ("time" or "interval" based, optional,
default "interval")
Returns
						mixedThe cron task ID created, or void on error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			edit( integer $task_id, array $vars )
				
Edits a cron task Parameters
						$task_idinteger$task_id The cron task ID to edit
$varsarray$vars A list of key=>value fields to update, including: - name The name of
this cron task - description The description of this cron task (optional) -
is_lang 1 if name and description are language definitions in the language file,
0 otherwise (optional, default 0)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $task_id, integer $plugin_dir )
				
Deletes a plugin's cron task 
				
Deletes a plugin's cron task Parameters
						$task_idinteger$task_id The ID of this cron task
$plugin_dirinteger$plugin_dir The plugin directory of the plugin this cron task belongs to
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			addTaskRun( integer $task_id, array $vars )
				
Sets when a cron task should run for a given company 
				
Sets when a cron task should run for a given company Parameters
						$task_idinteger$task_id The cron task ID associated with this runnable task
$varsarray$vars A list of key=>value fields to add, including: - time The daily 24-hour
time that this task should run (e.g. "14:25", optional, required if interval is
not given) - interval The interval, in minutes, that this cron task should run
(optional, required if time is not given) - enabled 1 if this cron task is
enabled, 0 otherwise (optional, default 1)
Returns
						mixedThe cron task run ID created, or void on error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			editTaskRun( integer $task_run_id, array $vars )
				
Updates when a cron task should run for the given company 
				
Updates when a cron task should run for the given company Parameters
						$task_run_idinteger$task_run_id The cron task run ID
$varsarray$vars A list of key=>value fields to update, including: - time The daily
24-hour time that this task should run (e.g. "14:25", optional, required if
interval is not given) - interval The interval, in minutes, that this cron task
should run (optional, required if time is not given) - enabled 1 if this cron
task is enabled, 0 otherwise (optional, default 1)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			deleteTaskRun( integer $task_run_id )
				
Deletes when a cron task should run for the given company. NOTE: This will
also delete the cron task itself iff the cron task is no longer used by any
other company and this cron task is related to a plugin 
				
Deletes when a cron task should run for the given company. NOTE: This will
also delete the cron task itself iff the cron task is no longer used by any
other company and this cron task is related to a plugin Parameters
						$task_run_idinteger$task_run_id The cron task run ID
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getTaskRun( integer $task_run_id, boolean $system = false )
				
Retrieves a cron task and its company-specific run settings 
				
Retrieves a cron task and its company-specific run settings Parameters
						$task_run_idinteger$task_run_id The cron task run ID
$systemboolean$system True to fetch only system cron tasks, false to fetch company cron tasks
(default false)
Returns
						mixedAn stdClass object representing the runnable cron task, or false if one does not
exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getTaskRunByKey( string $key, string $plugin_dir = null, boolean $system = false )
				
Retrieves a cron task and its company-specific run settings 
				
Retrieves a cron task and its company-specific run settings Parameters
						$keystring$key The cron task key
$plugin_dirstring$plugin_dir The cron task plugin directory (optional, default null)
$systemboolean$system True to fetch only system cron tasks, false to fetch company cron tasks
(default false)
Returns
						mixedAn stdClass object representing the runnable cron task, or false if one does not
exist
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAllTaskRun( boolean $system = false )
				
Retrieves a list of all cron tasks and their company-specific run settings
for this company 
				
Retrieves a list of all cron tasks and their company-specific run settings
for this company Parameters
						$systemboolean$system True to fetch only system cron tasks, false to fetch company cron tasks
(default false)
Returns
						arrayA list of stdClass objects representing each cron task, or an empty array if
none exist
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateKeyUnique( string $key, string $plugin_dir, integer $cron_task_id = null )
				
Validates whether the given cron task key and plugin directory are in use by
another cron task 
				
Validates whether the given cron task key and plugin directory are in use by
another cron task Parameters
						$keystring$key The key to check
$plugin_dirstring$plugin_dir The plugin directory
$cron_task_idinteger$cron_task_id The cron task ID to exclude from the check (optional)
Returns
						booleanTrue if the given key is unique, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateTaskType( string $type )
				
Validates that the given task type is a valid type 
				
Validates that the given task type is a valid type Parameters
						$typestring$type The cron task type
Returns
						booleanTrue if the type is valid, false otherwise
 
 | 
		
		Methods inherited from AppModel
		
			_(), 
			boolToInt(), 
			currencyToDecimal(), 
			dateToUtc(), 
			errors(), 
			getPerPage(), 
			ifSet(), 
			loadCrypto(), 
			setDefaultIfEmpty(), 
			setPerPage(), 
			setRulesIfSet(), 
			strToBool(), 
			systemDecrypt(), 
			systemEncrypt(), 
			systemHash(), 
			truncateDecimal(), 
			validateExists(), 
			validateStateCountry()
		
		Methods inherited from Model
		
			affectedRows(), 
			begin(), 
			commit(), 
			getConnection(), 
			lastInsertId(), 
			makeDSN(), 
			prepare(), 
			query(), 
			rollBack(), 
			setAttribute(), 
			setFetchMode()
		
		Magic methods summary
		Properties summary
		Properties inherited from AppModel
		
			$replacement_keys