Menu

## Object_Sync_Sf_Salesforce_Push
in package

class-object-sync-sf-salesforce-push.php : 14

Object_Sync_Sf_Salesforce_Push class.

### Table of Contents

$debug : bool
  Whether the plugin is in debug mode
$file : string
  The main plugin file
$logging : object
  Object_Sync_Sf_Logging class
$login_credentials : array<string|int, mixed>
  Login credentials for the Salesforce API; comes from wp-config or from the plugin settings
$mappings : object
  Object_Sync_Sf_Mapping class
$option_prefix : string
  The plugin's prefix when saving options to the database
$queue : object
  Object_Sync_Sf_Queue class
$salesforce : array<string|int, mixed>
  Object_Sync_Sf_Salesforce class This contains Salesforce API methods
$schedulable_classes : array<string|int, mixed>
  Array of what classes in the plugin can be scheduled to occur with `wp_cron` events
$schedule_name : string
  The name of the ActionScheduler queue
$slug : string
  The plugin's slug so we can include it when necessary
$sync_transients : object
  Object_Sync_Sf_Sync_Transients class
$version : string
  Current version of the plugin
$wordpress : object
  Object_Sync_Sf_WordPress class
$wpdb : object
  Global object of `$wpdb`, the WordPress database
__construct() : mixed
  Constructor for push class
acf_save() : mixed
  Callback method for saving a post with ACF. If it's a front end save, send the data to post_actions.
add_actions() : mixed
  Create the action hooks based on what object maps exist from the admin settings.
add_attachment() : mixed
  Callback method for adding an attachment
add_comment() : mixed
  Callback method for adding a comment
add_term() : mixed
  Callback method for adding a term
add_user() : mixed
  Callback method for adding a user
delete_attachment() : mixed
  Callback method for deleting an attachment
delete_comment() : mixed
  Callback method for deleting a comment
delete_term() : mixed
  Callback method for deleting a term
delete_user() : mixed
  Callback method for deleting a user
edit_attachment() : mixed
  Callback method for editing an attachment
edit_comment() : mixed
  Callback method for editing a comment
edit_term() : mixed
  Callback method for editing a term
edit_user() : mixed
  Callback method for editing a user
manual_push() : mixed
  Method for ajax hooks to call for pushing manually
post_actions() : mixed
  Callback method for posts of any type This can handle create, update, and delete actions
salesforce_push_sync_rest() : true
  Sync WordPress objects and Salesforce objects using the REST API.
um_add_user() : mixed
  Callback method for adding a user via the Ultimate Member plugin
create_object_map() : int
  Create an object map between a WordPress object and a Salesforce object
is_push_allowed() : bool
  Find out if push is allowed for this record
object_delete() : mixed
  Delete an existing object This calls the overall push crud method, which controls queuing and sending data to the Salesforce class.
object_insert() : mixed
  Insert a new object This calls the overall push crud method, which controls queuing and sending data to the Salesforce class.
object_update() : mixed
  Update an existing object This calls the overall push crud method, which controls queuing and sending data to the Salesforce class.
parse_error_message() : string
  Format the error message
salesforce_push_object_crud() : mixed
  Push objects to Salesforce.

### Properties

#### $debug

class-object-sync-sf-salesforce-push.php : 113

Whether the plugin is in debug mode

`public bool $debug`

#### $file

class-object-sync-sf-salesforce-push.php : 28

The main plugin file

`public string $file`

#### $logging

class-object-sync-sf-salesforce-push.php : 77

Object_Sync_Sf_Logging class

`public object $logging`

#### $login_credentials

class-object-sync-sf-salesforce-push.php : 56

Login credentials for the Salesforce API; comes from wp-config or from the plugin settings

`public array<string|int, mixed> $login_credentials`

#### $mappings

class-object-sync-sf-salesforce-push.php : 84

Object_Sync_Sf_Mapping class

`public object $mappings`

#### $option_prefix

class-object-sync-sf-salesforce-push.php : 49

The plugin's prefix when saving options to the database

`public string $option_prefix`

#### $queue

class-object-sync-sf-salesforce-push.php : 70

Object_Sync_Sf_Queue class

`public object $queue`

#### $salesforce

class-object-sync-sf-salesforce-push.php : 99

Object_Sync_Sf_Salesforce class This contains Salesforce API methods

`public array<string|int, mixed> $salesforce`

#### $schedulable_classes

class-object-sync-sf-salesforce-push.php : 63

Array of what classes in the plugin can be scheduled to occur with `wp_cron` events

`public array<string|int, mixed> $schedulable_classes`

#### $schedule_name

class-object-sync-sf-salesforce-push.php : 120

The name of the ActionScheduler queue

`public string $schedule_name`

#### $slug

class-object-sync-sf-salesforce-push.php : 42

The plugin's slug so we can include it when necessary

`public string $slug`

#### $sync_transients

class-object-sync-sf-salesforce-push.php : 106

Object_Sync_Sf_Sync_Transients class

`public object $sync_transients`

#### $version

class-object-sync-sf-salesforce-push.php : 21

Current version of the plugin

`public string $version`

#### $wordpress

class-object-sync-sf-salesforce-push.php : 91

Object_Sync_Sf_WordPress class

`public object $wordpress`

#### $wpdb

class-object-sync-sf-salesforce-push.php : 35

Global object of `$wpdb`, the WordPress database

`public object $wpdb`

### Methods

#### __construct()

class-object-sync-sf-salesforce-push.php : 125

Constructor for push class

`public __construct() : mixed`

##### Return values

mixed —

#### acf_save()

class-object-sync-sf-salesforce-push.php : 302

Callback method for saving a post with ACF. If it's a front end save, send the data to post_actions.

`public acf_save(int $post_id) : mixed`

##### Parameters

$post_id : int

  the ID of the post.

##### Return values

mixed —

#### add_actions()

class-object-sync-sf-salesforce-push.php : 156

Create the action hooks based on what object maps exist from the admin settings.

`public add_actions() : mixed`

We do not have any actions for blogroll at this time.

##### Return values

mixed —

#### add_attachment()

class-object-sync-sf-salesforce-push.php : 380

Callback method for adding an attachment

`public add_attachment(string $post_id) : mixed`

##### Parameters

$post_id : string

  the WordPress attachment ID.

##### Return values

mixed —

#### add_comment()

class-object-sync-sf-salesforce-push.php : 450

Callback method for adding a comment

`public add_comment(string $comment_id, string $comment_approved[, array<string|int, mixed> $commentdata = array() ]) : mixed`

##### Parameters

$comment_id : string

  the WordPress comment ID.

$comment_approved : string

  if the comment was approved.

$commentdata : array<string|int, mixed> = array()

  the data for the comment.

##### Return values

mixed —

#### add_term()

class-object-sync-sf-salesforce-push.php : 413

Callback method for adding a term

`public add_term(string $term_id, string $tt_id, string $taxonomy) : mixed`

##### Parameters

$term_id : string

  the term ID.

$tt_id : string

  the taxonomy ID.

$taxonomy : string

  the taxonomy name.

##### Return values

mixed —

#### add_user()

class-object-sync-sf-salesforce-push.php : 253

Callback method for adding a user

`public add_user(string $user_id) : mixed`

##### Parameters

$user_id : string

  the WordPress user ID.

##### Return values

mixed —

#### delete_attachment()

class-object-sync-sf-salesforce-push.php : 400

Callback method for deleting an attachment

`public delete_attachment(string $post_id) : mixed`

##### Parameters

$post_id : string

  the WordPress attachment ID.

##### Return values

mixed —

#### delete_comment()

class-object-sync-sf-salesforce-push.php : 470

Callback method for deleting a comment

`public delete_comment(string $comment_id) : mixed`

##### Parameters

$comment_id : string

  the WordPress comment ID.

##### Return values

mixed —

#### delete_term()

class-object-sync-sf-salesforce-push.php : 437

Callback method for deleting a term

`public delete_term(int $term, int $tt_id, string $taxonomy, object $deleted_term) : mixed`

##### Parameters

$term : int

  (id).

$tt_id : int

  the term taxonomy ID.

$taxonomy : string

  (slug).

$deleted_term : object

  the deleted term object.

##### Return values

mixed —

#### delete_user()

class-object-sync-sf-salesforce-push.php : 291

Callback method for deleting a user

`public delete_user(string $user_id) : mixed`

##### Parameters

$user_id : string

  the WordPress user ID.

##### Return values

mixed —

#### edit_attachment()

class-object-sync-sf-salesforce-push.php : 390

Callback method for editing an attachment

`public edit_attachment(string $post_id) : mixed`

##### Parameters

$post_id : string

  the WordPress attachment ID.

##### Return values

mixed —

#### edit_comment()

class-object-sync-sf-salesforce-push.php : 460

Callback method for editing a comment

`public edit_comment(string $comment_id) : mixed`

##### Parameters

$comment_id : string

  the WordPress comment ID.

##### Return values

mixed —

#### edit_term()

class-object-sync-sf-salesforce-push.php : 424

Callback method for editing a term

`public edit_term(string $term_id, string $taxonomy) : mixed`

##### Parameters

$term_id : string

  the term ID.

$taxonomy : string

  the taxonomy name.

##### Return values

mixed —

#### edit_user()

class-object-sync-sf-salesforce-push.php : 281

Callback method for editing a user

`public edit_user(string $user_id, object $old_user_data) : mixed`

##### Parameters

$user_id : string

  the WordPress user ID.

$old_user_data : object

  the previously used user data.

##### Return values

mixed —

#### manual_push()

class-object-sync-sf-salesforce-push.php : 210

Method for ajax hooks to call for pushing manually

`public manual_push(string $object_type, int $wordpress_id, string $http_method) : mixed`

##### Parameters

$object_type : string

  the WordPress object type.

$wordpress_id : int

  the WordPress record ID.

$http_method : string

  the HTTP method that was called.

##### Return values

mixed —

#### post_actions()

class-object-sync-sf-salesforce-push.php : 319

Callback method for posts of any type This can handle create, update, and delete actions

`public post_actions(string $post_id, WP_Post|array<string|int, mixed> $post) : mixed`

##### Parameters

$post_id : string

  the WordPress post ID.

$post : WP_Post|array<string|int, mixed>

  the WordPress post object. For our purposes, it's never an array.

##### Return values

mixed —

#### salesforce_push_sync_rest()

class-object-sync-sf-salesforce-push.php : 771

Sync WordPress objects and Salesforce objects using the REST API.

`public salesforce_push_sync_rest(string $object_type, array<string|int, mixed>|int $object, array<string|int, mixed> $mapping, int $sf_sync_trigger) : true`

##### Parameters

$object_type : string

  Type of WordPress object.

$object : array<string|int, mixed>|int

  The WordPress object data or its ID value.

$mapping : array<string|int, mixed>

  Salesforce field mapping data array or ID.

$sf_sync_trigger : int

  Trigger for this sync.

##### Return values

true —

or exit the method

#### um_add_user()

class-object-sync-sf-salesforce-push.php : 264

Callback method for adding a user via the Ultimate Member plugin

`public um_add_user(string $user_id[, array<string|int, mixed> $form_data = array() ]) : mixed`

##### Parameters

$user_id : string

  the WordPress user ID.

$form_data : array<string|int, mixed> = array()

  the data that was sent to create the user.

##### Return values

mixed —

#### create_object_map()

class-object-sync-sf-salesforce-push.php : 1509

Create an object map between a WordPress object and a Salesforce object

`private create_object_map(array<string|int, mixed> $wordpress_object, string $id_field_name, string $salesforce_id, array<string|int, mixed> $field_mapping[, bool $pending = false ]) : int`

##### Parameters

$wordpress_object : array<string|int, mixed>

  Array of the WordPress object's data.

$id_field_name : string

  How this object names its primary field. ie Id or comment_id or whatever.

$salesforce_id : string

  Unique identifier for the Salesforce object.

$field_mapping : array<string|int, mixed>

  The row that maps the object types together, including which fields match which other fields.

$pending : bool = false

  check if it is a pending action or the full object map has already been created.

##### Return values

int —

$wpdb->insert_id This is the database row for the map object.

#### is_push_allowed()

class-object-sync-sf-salesforce-push.php : 1549

Find out if push is allowed for this record

`private is_push_allowed(string $object_type, array<string|int, mixed> $object, string $sf_sync_trigger, array<string|int, mixed> $mapping, array<string|int, mixed> $map_sync_triggers) : bool`

##### Parameters

$object_type : string

  WordPress object type.

$object : array<string|int, mixed>

  Array of the WordPress object's data.

$sf_sync_trigger : string

  The current operation's trigger.

$mapping : array<string|int, mixed>

  the fieldmap that maps the two object types.

$map_sync_triggers : array<string|int, mixed>

  the enabld map triggers.

##### Return values

bool —

$push_allowed Whether all this stuff allows the $api_result to be pushed to Salesforce

#### object_delete()

class-object-sync-sf-salesforce-push.php : 505

Delete an existing object This calls the overall push crud method, which controls queuing and sending data to the Salesforce class.

`private object_delete(array<string|int, mixed> $object, string $type) : mixed`

##### Parameters

$object : array<string|int, mixed>

  the object data to send to WordPress.

$type : string

  the WordPress object type.

##### Return values

mixed —

#### object_insert()

class-object-sync-sf-salesforce-push.php : 483

Insert a new object This calls the overall push crud method, which controls queuing and sending data to the Salesforce class.

`private object_insert(array<string|int, mixed> $object, string $type) : mixed`

##### Parameters

$object : array<string|int, mixed>

  the object data to send to WordPress.

$type : string

  the WordPress object type.

##### Return values

mixed —

#### object_update()

class-object-sync-sf-salesforce-push.php : 494

Update an existing object This calls the overall push crud method, which controls queuing and sending data to the Salesforce class.

`private object_update(array<string|int, mixed> $object, string $type) : mixed`

##### Parameters

$object : array<string|int, mixed>

  the object data to send to WordPress.

$type : string

  the WordPress object type.

##### Return values

mixed —

#### parse_error_message()

class-object-sync-sf-salesforce-push.php : 1488

Format the error message

`private parse_error_message(array<string|int, mixed> $e[, string $default_message = '' ]) : string`

##### Parameters

$e : array<string|int, mixed>

  the exception from the Salesforce class.

$default_message : string = ''

  if there is one.

##### Return values

string —

$message what is getting stored.

#### salesforce_push_object_crud()

class-object-sync-sf-salesforce-push.php : 518

Push objects to Salesforce.

`private salesforce_push_object_crud(string $object_type, array<string|int, mixed> $object, int $sf_sync_trigger[, bool $manual = false ]) : mixed`

This method decides whether to do the processing immediately or queue it to the schedule class (or skip it based on another plugin's activity)

##### Parameters

$object_type : string

  Type of WordPress object.

$object : array<string|int, mixed>

  The WordPress data that needs to be sent to Salesforce.

$sf_sync_trigger : int

  The trigger being responded to.

$manual : bool = false

  check if we are calling this manually.

##### Return values

mixed —

## Search results