You are here

public function SmartlingApiWrapper::deleteFile in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 src/Smartling/SmartlingApiWrapper.php \Drupal\tmgmt_smartling\Smartling\SmartlingApiWrapper::deleteFile()

Delete file.

Parameters

$fileUri:

Return value

bool

File

src/Smartling/SmartlingApiWrapper.php, line 489
SmartlingApiWrapper.php.

Class

SmartlingApiWrapper
Class SmartlingApiWrapper @package Drupal\tmgmt_smartling\Smartling

Namespace

Drupal\tmgmt_smartling\Smartling

Code

public function deleteFile($fileUri) {
  $result = FALSE;
  try {
    $result = $this
      ->getApi('file')
      ->deleteFile($fileUri);
    $this->logger
      ->info('Smartling deleted a file in Dashboard: @uri', [
      '@uri' => $fileUri,
    ]);
  } catch (SmartlingApiException $e) {
    $this->logger
      ->error('Smartling failed to delete a file in Dashboard: @uri.<br/>Error: @error', [
      '@uri' => $fileUri,
      '@error' => $e
        ->getMessage(),
    ]);
  }
  return $result;
}