Properties

$sync_off

$sync_off : 

Type

$sync_wordpress_create

$sync_wordpress_create : 

Type

$sync_wordpress_update

$sync_wordpress_update : 

Type

$sync_wordpress_delete

$sync_wordpress_delete : 

Type

$sync_sf_create

$sync_sf_create : 

Type

$sync_sf_update

$sync_sf_update : 

Type

$sync_sf_delete

$sync_sf_delete : 

Type

$wordpress_events

$wordpress_events : 

Type

$salesforce_events

$salesforce_events : 

Type

$direction_wordpress_sf

$direction_wordpress_sf : 

Type

$direction_sf_wordpress

$direction_sf_wordpress : 

Type

$direction_sync

$direction_sync : 

Type

$direction_wordpress

$direction_wordpress : 

Type

$direction_salesforce

$direction_salesforce : 

Type

$salesforce_default_record_type

$salesforce_default_record_type : 

Type

$array_delimiter

$array_delimiter : 

Type

$array_types_from_salesforce

$array_types_from_salesforce : 

Type

$date_types_from_salesforce

$date_types_from_salesforce : 

Type

$int_types_from_salesforce

$int_types_from_salesforce : 

Type

$name_length

$name_length : 

Type

$status_success

$status_success : 

Type

$status_error

$status_error : 

Type

$wpdb

$wpdb : 

Type

$version

$version : 

Type

$slug

$slug : 

Type

$logging

$logging : 

Type

$option_prefix

$option_prefix : 

Type

$fieldmap_table

$fieldmap_table : 

Type

$object_map_table

$object_map_table : 

Type

Methods

__construct()

__construct(object  $wpdb, string  $version, string  $slug, object  $logging, string  $option_prefix = '') 

Constructor which sets up links between the systems

Parameters

object $wpdb

A WPDB object.

string $version

The plugin version.

string $slug

The plugin slug.

object $logging

Object_Sync_Sf_Logging.

string $option_prefix

The plugin option prefix

Throws

\Exception

create_fieldmap()

create_fieldmap(array  $posted = array(), array  $wordpress_fields = array(), array  $salesforce_fields = array()) 

Create a fieldmap row between a WordPress and Salesforce object

Parameters

array $posted

The results of $_POST.

array $wordpress_fields

The fields for the WordPress side of the mapping.

array $salesforce_fields

The fields for the Salesforce side of the mapping.

Throws

\Exception

get_fieldmaps()

get_fieldmaps(integer  $id = null, array  $conditions = array(), boolean  $reset = false) : Array

Get one or more fieldmap rows between a WordPress and Salesforce object

Parameters

integer $id

The ID of a desired mapping.

array $conditions

Array of key=>value to match the mapping by.

boolean $reset

Unused parameter.

Throws

\Exception

Returns

Array —

$map a single mapping or $mappings, an array of mappings.

get_mapped_fields()

get_mapped_fields(Array  $mapping, Array  $directions = array()) : Array

For a mapping, get the fieldmaps associated with it.

Parameters

Array $mapping

The mapping for which we are getting the fieldmaps.

Array $directions

The direction of the mapping: from WP to SF or vice-versa.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

Array —

of mapped fields

get_mapped_record_types()

get_mapped_record_types(Array  $mapping) : Array

Get the mapped record types for a given mapping.

Parameters

Array $mapping

A mapping from which we wish to estract the record type.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

Array —

of mappings. Empty if the mapping's record type is default, else full of the record types.

update_fieldmap()

update_fieldmap(array  $posted = array(), array  $wordpress_fields = array(), array  $salesforce_fields = array(), integer  $id = '') : \$map

Update a fieldmap row between a WordPress and Salesforce object

Parameters

array $posted

It's $_POST.

array $wordpress_fields

The fields for the WordPress side of the mapping.

array $salesforce_fields

The fields for the Salesforce side of the mapping.

integer $id

The ID of the mapping.

Throws

\Exception

Returns

\$map

delete_fieldmap()

delete_fieldmap(integer  $id = '') : Boolean

Delete a fieldmap row between a WordPress and Salesforce object

Parameters

integer $id

The ID of a field mapping.

Throws

\Exception

Returns

Boolean

create_object_map()

create_object_map(array  $posted = array()) : false|Int

Create an object map row between a WordPress and Salesforce object

Parameters

array $posted

It's $_POST.

Throws

\Exception

Returns

false|Int —

of field mapping between WordPress and Salesforce objects

get_object_maps()

get_object_maps(array  $conditions = array(), boolean  $reset = false) : \$map

Get one or more object map rows between WordPress and Salesforce objects

Parameters

array $conditions

Limitations on the SQL query for object mapping rows.

boolean $reset

Unused parameter.

Throws

\Exception

Returns

\$map —

or $mappings

update_object_map()

update_object_map(array  $posted = array(), array  $id = '') : \$map

Update an object map row between a WordPress and Salesforce object

Parameters

array $posted

It's $_POST.

array $id

The ID of the object map row.

Throws

\Exception

Returns

\$map

delete_object_map()

delete_object_map(integer|array  $id = '') 

Delete an object map row between a WordPress and Salesforce object

Parameters

integer|array $id

The ID or IDs of the object map row(s).

Throws

\Exception

generate_temporary_id()

generate_temporary_id(string  $direction) : \$id

Delete an object map row between a WordPress and Salesforce object

Parameters

string $direction

Whether this is part of a push or pull action

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

\$id —

is a temporary string that will be replaced if the modification is successful

load_by_wordpress()

load_by_wordpress(string  $object_type, integer  $object_id, boolean  $reset = false) : \SalesforceMappingObject

Returns Salesforce object mappings for a given WordPress object.

Parameters

string $object_type

Type of object to load.

integer $object_id

Unique identifier of the target object to load.

boolean $reset

Whether or not the cache should be cleared and fetch from current data.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

\SalesforceMappingObject —

The requested SalesforceMappingObject or FALSE if none was found.

load_by_salesforce()

load_by_salesforce(string  $salesforce_id, boolean  $reset = false) : array

Returns Salesforce object mappings for a given Salesforce object.

Parameters

string $salesforce_id

Type of object to load.

boolean $reset

Whether or not the cache should be cleared and fetch from current data.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

$map The most recent fieldmap

map_params()

map_params(array  $mapping, array  $object, array  $trigger, boolean  $use_soap = false, boolean  $is_new = true, string  $object_id_field = '') : array

Map values between WordPress and Salesforce objects.

Parameters

array $mapping

Mapping object.

array $object

WordPress or Salesforce object data.

array $trigger

The thing that triggered this mapping.

boolean $use_soap

Flag to enforce use of the SOAP API.

boolean $is_new

Indicates whether a mapping object for this entity already exists.

string $object_id_field

optionally pass the object id field name

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

Associative array of key value pairs.

get_failed_object_maps()

get_failed_object_maps() : array

Check object map table to see if there have been any failed object map create attempts

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

$errors Associative array of rows that failed to finish from either system

get_failed_object_map()

get_failed_object_map(integer  $id) : array

Check object map table to see if there have been any failed object map create attempts

Parameters

integer $id

The ID of a desired mapping.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

$error Associative array of single row that failed to finish based on id

setup_fieldmap_data()

setup_fieldmap_data(array  $posted = array(), array  $wordpress_fields = array(), array  $salesforce_fields = array()) : \$data

Setup fieldmap data Sets up the database entry for mapping the object types between Salesforce and WordPress

Parameters

array $posted

It's $_POST.

array $wordpress_fields

The fields for the WordPress side of the mapping.

array $salesforce_fields

The fields for the Salesforce side of the mapping.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

\$data

setup_object_map_data()

setup_object_map_data(array  $posted = array()) : \$data

Setup the data for the object map

Parameters

array $posted

It's $_POST.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

\$data —

Filtered array with only the keys that are in the object map database table. Strips out things from WordPress form if they're present.

prepare_fieldmap_data()

prepare_fieldmap_data(array  $mappings, string  $record_type = '') : array

Prepare field map data for use

Parameters

array $mappings

Array of fieldmaps.

string $record_type

Optional Salesforce record type to see if it is allowed or not.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

$mappings Associative array of field maps ready to use