Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage Class Reference

Storage class for stashed translations. More...

Inheritance diagram for MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage:
MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashReader MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashWriter

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.
 

Detailed Description

Storage class for stashed translations.

This one uses sql tables as storage.

Author
Niklas Laxström @license GPL-2.0-or-later
Since
2013.06 (namespaced in 2020.11)

Definition at line 17 of file TranslationStashStorage.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::__construct ( private readonly IDatabase $db,
private readonly string $dbTable = 'translate_stash' )

Definition at line 19 of file TranslationStashStorage.php.

Member Function Documentation

◆ addTranslation()

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.

◆ deleteTranslations()

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.

◆ getTranslations()

MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::getTranslations ( User $user)

Gets all stashed translations for the given user.

Returns
StashedTranslation[]

Implements MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashReader.

Definition at line 25 of file TranslationStashStorage.php.


The documentation for this class was generated from the following file: