You are here

function eloqua_post_load in Eloqua 6

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

Loads a post form the database @hook eloqua_post_load ($post)

Parameters

$post_id int:

Return value

object

File

./eloqua.inc, line 425

Code

function eloqua_post_load($post_id) {

  // Get the raw result from the db
  if (!is_numeric($post_id)) {
    $type = gettype($post_id);
    watchdog(ELOQUA_WATCHDOG_CATEGORY, t('Invalid argument sent to !module_name (!type).', array(
      '!module_name' => __FUNCTION__,
      '!type' => $type,
    )), array(), WATCHDOG_DEBUG);
    return NULL;
  }
  $post = _eloqua_post_load($post_id);
  if (empty($post)) {
    return NULL;
  }

  // Send the object around to all of its friends
  foreach (module_implements('eloqua_post_load') as $module_name) {
    $method = $module_name . '_eloqua_post_load';
    $method($post);
  }
  return $post;
}