Properties

$wpdb

$wpdb : 

Type

$version

$version : 

Type

$login_credentials

$login_credentials : 

Type

$slug

$slug : 

Type

$wordpress

$wordpress : 

Type

$salesforce

$salesforce : 

Type

$mappings

$mappings : 

Type

$schedule_name

$schedule_name : 

Type

$logging

$logging : 

Type

Methods

__construct()

__construct(object  $wpdb, string  $version, array  $login_credentials, string  $slug, object  $wordpress, object  $salesforce, object  $mappings, string  $schedule_name,   $logging,   $schedulable_classes) 

Constructor which sets up schedule and handler for when schedule runs

Parameters

object $wpdb
string $version
array $login_credentials
string $slug
object $wordpress
object $salesforce
object $mappings
string $schedule_name
$logging
$schedulable_classes

Throws

\Exception

add_actions()

add_actions() 

Create the actions to run

set_schedule_frequency()

set_schedule_frequency(  $schedules) 

Convert the schedule frequency from the admin settings into an array interval must be in seconds for the class to use it

Parameters

$schedules

get_schedule_frequency_key()

get_schedule_frequency_key(  $name = '') 

Convert the schedule frequency from the admin settings into an array interval must be in seconds for the class to use it

Parameters

$name

get_schedule_frequency_seconds()

get_schedule_frequency_seconds(  $name = '') 

Convert the schedule frequency from the admin settings into seconds

Parameters

$name

use_schedule()

use_schedule(  $name = '') : void

Schedule function This creates and manages the scheduling of the task

Parameters

$name

maybe_handle()

maybe_handle(  $already_checked = false,   $ajax = false) 

Maybe process queue

Checks whether data exists within the queue and that the process is not already running.

Parameters

$already_checked
$ajax

cancel_by_name()

cancel_by_name(  $name) 

Method to cancel a specific queue by its name

This is modeled off the cancel_process method in wp-background-process but that one doesn't seem to work when we need to specify the queue name

Parameters

$name

count_queue_items()

count_queue_items(  $schedule_name = '') : boolean

How many items are in this queue? Based on is_queue_empty from base library

Parameters

$schedule_name

Returns

boolean

task()

task(mixed  $data) : mixed

Task

Override this method to perform any actions required on the queue data. Return the modified data for further processing in the next pass through. Or, return false to remove the data from the queue.

Parameters

mixed $data

Queue data to iterate over

Returns

mixed

check_for_data()

check_for_data() : \$data

Check for data

This method is new to the extension. It allows a scheduled method to do nothing but call the callback parameter of its calling class. This is useful for running the salesforce_pull event to check for updates in Salesforce

Returns

\$data

complete()

complete() 

Complete

Override if applicable, but ensure that the below actions are performed, or, call parent::complete().