You are here

function coder_upgrade_upgrade_call_taxonomy_get_tree_alter in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/conversions/call.inc \coder_upgrade_upgrade_call_taxonomy_get_tree_alter()

Implements hook_upgrade_call_taxonomy_get_tree_alter().

File

coder_upgrade/conversions/call.inc, line 2379
Provides conversion routines applied to function calls.

Code

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

  // DONE
  // Create helper objects.
  $editor = PGPEditor::getInstance();

  // Get the function call object.
  $item =& $node->data;

  // Process function call.
  $name =& $item->name;
  $depth = '$max_depth = NULL /* TODO Set this variable. */';
  $count = $item->parameters
    ->count();

  // Adjust parameters.
  if ($count > 3) {

    // Switch places.
    $p2 = $item
      ->getParameter(2);
    $p3 = $item
      ->getParameter(3);
    $item
      ->setParameter(2, $p3);
    $item
      ->setParameter(3, $p2);
  }
  elseif ($count > 2) {

    // Insert parameter due to change in parameter order.
    $editor
      ->insertParameter($item, 2, $depth);
    $count = $item->parameters
      ->count();
  }
  $defaults = array(
    array(
      'NULL',
      $depth,
    ),
    '-1',
  );
  $string = $editor
    ->removeDefaults($item, 2, $defaults);
}