You are here

function coder_upgrade_upgrade_call_db_query_range_alter in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/conversions/db.inc \coder_upgrade_upgrade_call_db_query_range_alter()

Implements hook_upgrade_call_db_query_range_alter().

File

coder_upgrade/conversions/db.inc, line 46
Provides conversion routines applied to database API function calls and hooks.

Code

function coder_upgrade_upgrade_call_db_query_range_alter(&$node, &$reader) {

  // NEEDS WORK
  // Disable this routine until it is improved.
  //  return;
  // Get the function call object.
  $item =& $node->data;
  $from = $count = 0;
  if ($item
    ->parameterCount() < 3) {
    clp("ERROR: db_query_range() has less than three parameters.");

    // Nothing to do.
    //    return;
  }
  else {

    // Save the values from and delete the last two parameters.
    $i = $item
      ->parameterCount() - 1;
    $from = $item
      ->getParameter($i)
      ->stripComments()
      ->toString();
    $item
      ->deleteParameter($i);
    $i--;
    $count = $item
      ->getParameter($i)
      ->stripComments()
      ->toString();
    $item
      ->deleteParameter($i);
  }

  //  coder_upgrade_upgrade_call_db_query_alter($node, $reader);
  if ($sql = coder_upgrade_locate_query_string($node)) {

    // Parse the string.
    coder_upgrade_parse_query_string($node, $sql, $from, $count);
  }

  // Add finishing touches to new query syntax for a range query.
  // See http://drupal.org/node/310075.
  // ->range($from, $count)
}