$sync_off
$sync_off :
Map objects and records between WordPress and Salesforce
__construct(object $wpdb, string $version, string $slug, object $logging, string $option_prefix = '')
Constructor which sets up links between the systems
| 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 |
create_fieldmap(array $posted = array(), array $wordpress_fields = array(), array $salesforce_fields = array())
Create a fieldmap row between a WordPress and Salesforce object
| 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. |
get_fieldmaps(integer $id = null, array $conditions = array(), boolean $reset = false) : Array
Get one or more fieldmap rows between a WordPress and Salesforce object
| integer | $id | The ID of a desired mapping. |
| array | $conditions | Array of key=>value to match the mapping by. |
| boolean | $reset | Unused parameter. |
$map a single mapping or $mappings, an array of mappings.
get_mapped_fields(Array $mapping, Array $directions = array()) : Array
For a mapping, get the fieldmaps associated with it.
| 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. |
of mapped fields
get_mapped_record_types(Array $mapping) : Array
Get the mapped record types for a given mapping.
| Array | $mapping | A mapping from which we wish to estract the record type. |
of mappings. Empty if the mapping's record type is default, else full of the record types.
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
| 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. |
get_object_maps(array $conditions = array(), boolean $reset = false) : \$map
Get one or more object map rows between WordPress and Salesforce objects
| array | $conditions | Limitations on the SQL query for object mapping rows. |
| boolean | $reset | Unused parameter. |
or $mappings
generate_temporary_id(string $direction) : \$id
Delete an object map row between a WordPress and Salesforce object
| string | $direction | Whether this is part of a push or pull action |
is a temporary string that will be replaced if the modification is successful
load_by_wordpress(string $object_type, integer $object_id, boolean $reset = false) : \SalesforceMappingObject
Returns Salesforce object mappings for a given WordPress object.
| 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. |
The requested SalesforceMappingObject or FALSE if none was found.
load_by_salesforce(string $salesforce_id, boolean $reset = false) : array
Returns Salesforce object mappings for a given Salesforce object.
| string | $salesforce_id | Type of object to load. |
| boolean | $reset | Whether or not the cache should be cleared and fetch from current data. |
$map The most recent fieldmap
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.
| 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 |
Associative array of key value pairs.
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$errors Associative array of rows that failed to finish from either system
get_failed_object_map(integer $id) : array
Check object map table to see if there have been any failed object map create attempts
| integer | $id | The ID of a desired mapping. |
$error Associative array of single row that failed to finish based on id
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
| 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. |
setup_object_map_data(array $posted = array()) : \$data
Setup the data for the object map
| array | $posted | It's $_POST. |
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(array $mappings, string $record_type = '') : array
Prepare field map data for use
| array | $mappings | Array of fieldmaps. |
| string | $record_type | Optional Salesforce record type to see if it is allowed or not. |
$mappings Associative array of field maps ready to use