You are here

function services_admin_browse_test_unserialize_args in Services 5

Same name and namespace in other branches
  1. 6 services_admin_browse.inc \services_admin_browse_test_unserialize_args()
  2. 6.2 services_admin_browse.inc \services_admin_browse_test_unserialize_args()
  3. 7 services_admin_browse.inc \services_admin_browse_test_unserialize_args()
1 call to services_admin_browse_test_unserialize_args()
services_admin_browse_test_submit in ./services_admin_browse.inc

File

./services_admin_browse.inc, line 175
The file contains code which is used to create the services testing interface

Code

function services_admin_browse_test_unserialize_args($values) {
  $method = services_method_get(arg(4));

  // Convert args.
  for ($c = count($method['#args']) - 1; $c >= 0; $c--) {
    $arg = $method['#args'][$c];
    $value = $values[$c];

    // Remove empty values from end of array.
    // Once we find a value, we can no longer skip.
    if (!is_numeric($value) && empty($value) && !$noskip) {
      continue;
    }
    $noskip = TRUE;
    switch ($arg['#type']) {
      case 'array':
        if (empty($value)) {
          $return[$c] = NULL;
        }
        else {
          $return[$c] = explode(',', $value);
        }
        break;
      default:
        $return[$c] = $value;
    }
  }
  if ($return) {
    ksort($return);
  }

  //die(print_r($return, true));
  return $return;
}