You are here

class LingotekFakeBC in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 4.0.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  2. 3.0.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  3. 3.1.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  4. 3.2.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  5. 3.3.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  6. 3.4.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  7. 3.5.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  8. 3.6.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  9. 3.7.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
  10. 3.8.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC

Hierarchy

Expanded class hierarchy of LingotekFakeBC

File

tests/modules/lingotek_test/src/LingotekFakeBC.php, line 9

Namespace

Drupal\lingotek_test
View source
class LingotekFakeBC extends LingotekFake implements LingotekInterface {
  public function updateDocument($doc_id, $content, $url = NULL, $title = NULL, LingotekProfileInterface $profile = NULL, $job_id = NULL) {
    if (\Drupal::state()
      ->get('lingotek.must_error_in_upload', FALSE)) {
      throw new LingotekApiException('Error was forced.');
    }
    if (is_array($content)) {
      $content = json_encode($content);
    }
    \Drupal::state()
      ->set('lingotek.uploaded_content', $content);
    \Drupal::state()
      ->set('lingotek.uploaded_content_url', $url);
    \Drupal::state()
      ->set('lingotek.uploaded_title', $title);
    \Drupal::state()
      ->set('lingotek.uploaded_job_id', $job_id);

    // Save the timestamp of the upload.
    $timestamps = \Drupal::state()
      ->get('lingotek.upload_timestamps', []);
    $timestamps[$doc_id] = REQUEST_TIME;
    \Drupal::state()
      ->set('lingotek.upload_timestamps', $timestamps);

    // Our document is always imported correctly.
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LingotekFake::$api protected property
LingotekFake::$config protected property
LingotekFake::addTarget public function Requests a translation to the Lingotek service. Overrides LingotekInterface::addTarget
LingotekFake::cancelDocument public function Cancels the document with this document id from the Lingotek service. Overrides LingotekInterface::cancelDocument
LingotekFake::cancelDocumentTarget public function Cancels the document target with this document id and locale from the Lingotek service. Overrides LingotekInterface::cancelDocumentTarget
LingotekFake::create public static function Overrides LingotekInterface::create
LingotekFake::deleteDocument public function Deletes the document with this document id from the Lingotek service. Overrides LingotekInterface::deleteDocument
LingotekFake::documentImported public function Overrides LingotekInterface::documentImported
LingotekFake::downloadDocument public function Overrides LingotekInterface::downloadDocument
LingotekFake::get public function Overrides LingotekInterface::get
LingotekFake::getAccountInfo public function Overrides LingotekInterface::getAccountInfo
LingotekFake::getCommunities public function Overrides LingotekInterface::getCommunities
LingotekFake::getDefaults public function Overrides LingotekInterface::getDefaults
LingotekFake::getDocumentStatus public function Overrides LingotekInterface::getDocumentStatus
LingotekFake::getDocumentTranslationStatus public function Checks the status of the translation. Overrides LingotekInterface::getDocumentTranslationStatus
LingotekFake::getDocumentTranslationStatuses public function Overrides LingotekInterface::getDocumentTranslationStatuses
LingotekFake::getEditable public function
LingotekFake::getFilters public function Get all the available filters. Overrides LingotekInterface::getFilters
LingotekFake::getLocales public function Get the available locales on Lingotek. Overrides LingotekInterface::getLocales
LingotekFake::getLocalesInfo public function Get the available locales on Lingotek. Overrides LingotekInterface::getLocalesInfo
LingotekFake::getProject public function Overrides LingotekInterface::getProject
LingotekFake::getProjects public function Overrides LingotekInterface::getProjects
LingotekFake::getResources public function Overrides LingotekInterface::getResources
LingotekFake::getUploadedTimestamp public function Gets the last edited timestamp from Lingotek service. Overrides LingotekInterface::getUploadedTimestamp
LingotekFake::getVaults public function Overrides LingotekInterface::getVaults
LingotekFake::getWorkflows public function Overrides LingotekInterface::getWorkflows
LingotekFake::set public function Overrides LingotekInterface::set
LingotekFake::setProjectCallBackUrl public function Overrides LingotekInterface::setProjectCallBackUrl
LingotekFake::SETTINGS constant
LingotekFake::uploadDocument public function Uploads a document to the Lingotek service. Overrides LingotekInterface::uploadDocument
LingotekFake::__construct public function
LingotekFakeBC::updateDocument public function Updates a document in the Lingotek service. Overrides LingotekFake::updateDocument