class LingotekFakeBC in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8.2 tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 4.0.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.0.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.1.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.2.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.4.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.5.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.6.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.7.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
- 3.8.x tests/modules/lingotek_test/src/LingotekFakeBC.php \Drupal\lingotek_test\LingotekFakeBC
Hierarchy
- class \Drupal\lingotek_test\LingotekFake implements LingotekInterface
- class \Drupal\lingotek_test\LingotekFakeBC implements LingotekInterface
Expanded class hierarchy of LingotekFakeBC
File
- tests/
modules/ lingotek_test/ src/ LingotekFakeBC.php, line 9
Namespace
Drupal\lingotek_testView 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] = \Drupal::time()
->getRequestTime();
\Drupal::state()
->set('lingotek.upload_timestamps', $timestamps);
// Our document is always imported correctly.
return TRUE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LingotekFake:: |
protected | property | ||
LingotekFake:: |
protected | property | ||
LingotekFake:: |
public | function |
Requests a translation to the Lingotek service. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Cancels the document with this document id from the Lingotek service. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Cancels the document target with this document id and locale from the Lingotek service. Overrides LingotekInterface:: |
|
LingotekFake:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
LingotekFake:: |
public | function | ||
LingotekFake:: |
public | function |
Gets the translation of a document for a given locale. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets data from the configuration object. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Get the account information. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the account related communities. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets a document status. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the status of the translation. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the status of the translations. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets data from the mutable configuration object.
Returns an mutable configuration object for a given name. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Get all the available filters. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Get the available locales on Lingotek. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Get the available locales on Lingotek with extra information. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the project with the given ID. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the account related projects. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the account related resources. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the last edited timestamp from Lingotek service. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the account related vaults. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Gets the account related workflows. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Set a setting value (and save). Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function |
Sets the project callback url. Overrides LingotekInterface:: |
|
LingotekFake:: |
constant | |||
LingotekFake:: |
public | function |
Uploads a document to the Lingotek service. Overrides LingotekInterface:: |
|
LingotekFake:: |
public | function | ||
LingotekFakeBC:: |
public | function |
Updates a document in the Lingotek service. Overrides LingotekFake:: |