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 (IDatabase $db, string $table='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.
 

Protected Attributes

 $db
 
 $dbTable
 

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 ( IDatabase $db,
string $table = 'translate_stash' )

Definition at line 23 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 49 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 66 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 28 of file TranslationStashStorage.php.

Member Data Documentation

◆ $db

MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::$db
protected

Definition at line 19 of file TranslationStashStorage.php.

◆ $dbTable

MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashStorage::$dbTable
protected

Definition at line 21 of file TranslationStashStorage.php.


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