Storage class for stashed translations. More...
Public Member Functions | |
| __construct (private readonly IDatabase $db, private readonly string $dbTable='translate_stash',) | |
| getTranslations (User $user) | |
| Gets all stashed translations for the given user. | |
| addTranslation (StashedTranslation $item) | |
| Adds a new translation to the stash. | |
| deleteTranslations (User $user) | |
| Delete all stashed translations for the given user. | |
Storage class for stashed translations.
This one uses sql tables as storage.
Definition at line 17 of file TranslationStashStorage.php.
| MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::__construct | ( | private readonly IDatabase | $db, |
| private readonly string | $dbTable = 'translate_stash' ) |
Definition at line 19 of file TranslationStashStorage.php.
| MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::addTranslation | ( | StashedTranslation | $item | ) |
Adds a new translation to the stash.
If the same key already exists, the previous translation and metadata will be replaced with the new one.
Implements MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashWriter.
Definition at line 46 of file TranslationStashStorage.php.
| MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::deleteTranslations | ( | User | $user | ) |
Delete all stashed translations for the given user.
Implements MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashWriter.
Definition at line 63 of file TranslationStashStorage.php.
| MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::getTranslations | ( | User | $user | ) |
Gets all stashed translations for the given user.
Implements MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashReader.
Definition at line 25 of file TranslationStashStorage.php.