You are here

function ARC_rdf_store_select_json_sub_handler::get_json_result_body in Taxonomy import/export via XML 5

Same name and namespace in other branches
  1. 5.2 arc/ARC_rdf_store_select_json_sub_handler.php \ARC_rdf_store_select_json_sub_handler::get_json_result_body()
  2. 6.2 arc/ARC_rdf_store_select_json_sub_handler.php \ARC_rdf_store_select_json_sub_handler::get_json_result_body()
  3. 6 arc/ARC_rdf_store_select_json_sub_handler.php \ARC_rdf_store_select_json_sub_handler::get_json_result_body()
1 call to ARC_rdf_store_select_json_sub_handler::get_json_result_body()
ARC_rdf_store_select_json_sub_handler::get_json_result in arc/ARC_rdf_store_select_json_sub_handler.php

File

arc/ARC_rdf_store_select_json_sub_handler.php, line 170

Class

ARC_rdf_store_select_json_sub_handler

Code

function get_json_result_body($args = "") {
  $ind = "  ";
  $ind2 = $ind . $ind;
  $ind3 = $ind2 . $ind;
  $ind4 = $ind3 . $ind;
  $nl = "\n";
  $jsoni = isset($args["result_type_args"]["jsoni"]) ? $args["result_type_args"]["jsoni"] : false;
  $jsonc = isset($args["result_type_args"]["jsonc"]) ? $args["result_type_args"]["jsonc"] : false;
  $distinct = isset($args["infos"]["distinct"]) ? $args["infos"]["distinct"] : false;
  $ordered = isset($args["infos"]["order_conditions"]) ? $args["infos"]["order_conditions"] : false;
  $code = "";
  $code .= $nl . $ind . 'results: {';

  /* distinct */
  $code .= $nl . $ind2 . 'distinct: ' . ($distinct ? 'true' : 'false');

  /* ordered */
  $code .= "," . $nl . $ind2 . 'ordered: ' . ($ordered ? 'true' : 'false');

  /* compact */
  $code .= "," . $nl . $ind2 . 'compact: ' . ($jsonc ? 'true' : 'false');

  /* indexed */
  $code .= "," . $nl . $ind2 . 'indexed: ' . ($jsoni ? 'true' : 'false');
  if ($jsoni) {

    /* index */
    $code .= "," . $nl . $ind2 . 'index: {';
    $code .= $this
      ->get_jsoni_result_body_index($args);
    $code .= $nl . $ind2 . '}';
  }
  else {

    /* bindings */
    $code .= "," . $nl . $ind2 . 'bindings: [';
    $code .= $this
      ->get_json_result_body_bindings($args);
    $code .= $nl . $ind2 . ']';
  }
  $code .= $nl . $ind . '}';
  return $code;
}