function resetFiles in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.2 api-sdk-php/examples/file-example.php \resetFiles()
- 8.2 vendor/smartling/api-sdk-php/examples/file-example.php \resetFiles()
- 8.3 vendor/smartling/api-sdk-php/examples/file-example.php \resetFiles()
@noinspection MoreThanThreeArgumentsInspection
Parameters
string $userIdentifier:
string $userSecretKey:
string $projectId:
array $files:
1 call to resetFiles()
- file-example.php in vendor/
smartling/ api-sdk-php/ examples/ file-example.php
File
- vendor/
smartling/ 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();
}
}
}