You are here

function eloqua_post_create in Eloqua 6

Same name and namespace in other branches
  1. 7.2 eloqua_webform/eloqua_webform.inc \eloqua_post_create()
  2. 7 eloqua_webform/eloqua_webform.inc \eloqua_post_create()

Creates a post into the database @hook eloqua_post_create

Parameters

$post object:

Return value

int Post ID

1 call to eloqua_post_create()
eloqua_webform_submit in ./eloqua.module
Submit handler for the webform

File

./eloqua.inc, line 456

Code

function eloqua_post_create($post) {
  if (!is_object($post)) {
    $type = gettype($post);
    watchdog(ELOQUA_WATCHDOG_CATEGORY, t('Invalid argument sent to !module_name (!type).', array(
      '!module_name' => __FUNCTION__,
      '!type' => $type,
    )));
    return FALSE;
  }
  $result = _eloqua_post_create($post);
  if (!$result) {

    // if we were unable to create the payment plan.  Can't go on.
    return FALSE;
  }
  $post->{ELOQUA_POST_FIELD_POST_ID} = $result;
  foreach (module_implements('eloqua_post_create') as $module_name) {
    $method = $module_name . '_eloqua_post_create';
    $method($post);
  }
  _eloqua_post_update($post);
  return $result;
}