You are here

function _eloqua_webform_create in Eloqua 6

Creates the webform object from the database

Parameters

$webform:

Return value

boolean

1 call to _eloqua_webform_create()
eloqua_webform_create in ./eloqua.inc
Creates a webform settings from the database @hook eloqua_form_create

File

./eloqua.inc, line 309

Code

function _eloqua_webform_create($webform) {
  $sql = 'INSERT INTO ' . ELOQUA_SCHEMA_WEBFORM . ' ( ' . ELOQUA_WEBFORM_FIELD_NODE_ID . ', ' . ELOQUA_WEBFORM_FIELD_FORM_NAME . ', ' . ELOQUA_WEBFORM_FIELD_ACTIVE . ', ' . ELOQUA_WEBFORM_FIELD_DATA . ' ) ' . ' VALUES ' . " (%d, '%s', %d, '%s') " . 'ON DUPLICATE KEY UPDATE ' . ELOQUA_WEBFORM_FIELD_FORM_NAME . " = '%s'," . ELOQUA_WEBFORM_FIELD_ACTIVE . ' = %d,' . ELOQUA_WEBFORM_FIELD_DATA . " = '%s'";
  $params = array(
    $webform->{ELOQUA_WEBFORM_FIELD_NODE_ID},
    $webform->{ELOQUA_WEBFORM_FIELD_FORM_NAME},
    $webform->{ELOQUA_WEBFORM_FIELD_ACTIVE},
    serialize($webform->{ELOQUA_WEBFORM_FIELD_DATA}),
    $webform->{ELOQUA_WEBFORM_FIELD_FORM_NAME},
    $webform->{ELOQUA_WEBFORM_FIELD_ACTIVE},
    serialize($webform->{ELOQUA_WEBFORM_FIELD_DATA}),
  );
  $result = _eloqua_insert_query($sql, $params);
  return $result;
}