function resetFiles in TMGMT Translator Smartling 8.2
Same name in this branch
- 8.2 api-sdk-php/examples/file-example.php \resetFiles()
- 8.2 vendor/smartling/api-sdk-php/examples/file-example.php \resetFiles()
Same name and namespace in other branches
@noinspection MoreThanThreeArgumentsInspection
Parameters
string $userIdentifier:
string $userSecretKey:
string $projectId:
array $files:
2 calls to resetFiles()
- file-example.php in api-sdk-php/
examples/ file-example.php - file-example.php in vendor/
smartling/ api-sdk-php/ examples/ file-example.php
File
- api-sdk-php/
examples/ file-example.php, line 272
Code
function resetFiles($userIdentifier, $userSecretKey, $projectId, array $files = []) {
echo '::: Reset File Example :::' . PHP_EOL;
$authProvider = \Smartling\AuthApi\AuthTokenProvider::create($userIdentifier, $userSecretKey);
foreach ($files as $file) {
try {
$fileApi = \Smartling\File\FileApi::create($authProvider, $projectId);
$fileApi
->deleteFile($file);
} catch (\Smartling\Exceptions\SmartlingApiException $e) {
echo $e
->formatErrors();
}
}
}