You are here

protected function ContextApi::processBodyOptions in TMGMT Translator Smartling 8.2

Same name in this branch
  1. 8.2 api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::processBodyOptions()
  2. 8.2 vendor/smartling/api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::processBodyOptions()
Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::processBodyOptions()
  2. 8.3 vendor/smartling/api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::processBodyOptions()

File

api-sdk-php/src/Context/ContextApi.php, line 74

Class

ContextApi
Class ContextApi

Namespace

Smartling\Context

Code

protected function processBodyOptions($requestData = []) {
  $opts = parent::processBodyOptions($requestData);
  $keys = [
    'content',
    'resource',
  ];
  if (!empty($opts['multipart'])) {
    foreach ($opts['multipart'] as &$data) {
      if (in_array($data['name'], $keys)) {
        $data['contents'] = $this
          ->readFile($data['contents']);
      }
    }
  }
  return $opts;
}