Fix formattazione API per App
This commit is contained in:
parent
5e6938da50
commit
5137f43631
|
@ -95,7 +95,7 @@ class Intervento extends Resource implements UpdateInterface
|
||||||
$this->importaRecords($key, $records);
|
$this->importaRecords($key, $records);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response;
|
return $this->forceToString($this->response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -176,4 +176,28 @@ class Intervento extends Resource implements UpdateInterface
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converte i valori numerici in stringhe.
|
||||||
|
*
|
||||||
|
* @param $list
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function forceToString($list)
|
||||||
|
{
|
||||||
|
$result = [];
|
||||||
|
// Fix per la gestione dei contenuti numerici
|
||||||
|
foreach ($list as $key => $value) {
|
||||||
|
if (is_numeric($value)) {
|
||||||
|
$result[$key] = (string) $value;
|
||||||
|
} elseif (is_array($value)) {
|
||||||
|
$result[$key] = $this->forceToString($value);
|
||||||
|
} else {
|
||||||
|
$result[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue