protected function BaseApiAbstract::processBodyOptions in TMGMT Translator Smartling 8.2
Same name in this branch
- 8.2 api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::processBodyOptions()
- 8.2 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::processBodyOptions()
Same name and namespace in other branches
- 8.4 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::processBodyOptions()
- 8.3 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::processBodyOptions()
Parameters
mixed $requestData:
Return value
array
2 calls to BaseApiAbstract::processBodyOptions()
- BaseApiAbstract::sendRequest in api-sdk-php/
src/ BaseApiAbstract.php - BaseApiAbstract::sendRequest in vendor/
smartling/ api-sdk-php/ src/ BaseApiAbstract.php
File
- api-sdk-php/
src/ BaseApiAbstract.php, line 290
Class
- BaseApiAbstract
- Class BaseApiAbstract
Namespace
SmartlingCode
protected function processBodyOptions($requestData = []) {
if (!empty($requestData['multipart'])) {
$body = [];
foreach ($requestData['multipart'] as $key => $value) {
// Hack to cast FALSE to '0' instead of empty string.
if (is_bool($value)) {
$value = (int) $value;
}
if (is_array($value)) {
foreach ($value as $_item) {
$body[] = [
'name' => $key . '[]',
'contents' => (string) $_item,
];
}
}
else {
$body[] = [
'name' => $key,
'contents' => $value,
];
}
}
$requestData['multipart'] = $body;
}
return $requestData;
}