You are here

function eloqua_post_update in Eloqua 7

Same name and namespace in other branches
  1. 6 eloqua.inc \eloqua_post_update()
  2. 7.2 eloqua_webform/eloqua_webform.inc \eloqua_post_update()

Updates a post from the database.

@hook eloqua_post_update

Parameters

object $post: The post object.

Return value

bool The result of the update.

1 call to eloqua_post_update()
_eloqua_cron in eloqua_webform/eloqua_webform.cron.inc
Cron helper function.

File

eloqua_webform/eloqua_webform.inc, line 293
Eloqua Helper functions and constants

Code

function eloqua_post_update($post) {
  if (!is_object($post)) {
    $type = gettype($post);
    watchdog('eloqua', 'Invalid argument sent to !module_name (!type).', array(
      '!module_name' => __FUNCTION__,
      '!type' => $type,
    ), WATCHDOG_DEBUG);
    return FALSE;
  }

  // Can't update the obvious invalid ppid of '0'...
  if (empty($post->{'post_id'})) {
    return FALSE;
  }
  foreach (module_implements('eloqua_post_update') as $module_name) {
    $method = $module_name . '_eloqua_post_update';
    $method($post);
  }

  // Save the result to the database and return the result.
  return _eloqua_post_update($post);
}