Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface Interface Reference

Interface for producing different kinds of graphs. More...

Inheritance diagram for MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface:
MediaWiki\Extension\Translate\Statistics\TranslationStatsBase MediaWiki\Extension\Translate\Statistics\TranslatePerLanguageStats MediaWiki\Extension\Translate\Statistics\TranslateRegistrationStats MediaWiki\Extension\Translate\Statistics\ReviewPerLanguageStats

Public Member Functions

 __construct (TranslationStatsGraphOptions $opts)
 Constructor.
 
 preQuery (&$tables, &$fields, &$conds, &$type, &$options, &$joins, $start, $end)
 Query details that the graph must fill.
 
 indexOf ( $row)
 Return the indexes which this result contributes to.
 
 labels ()
 Return the names of the variables being measured.
 
 getTimestamp ( $row)
 Return the timestamp associated with this result row.
 
 getDateFormat ()
 Return time formatting string.
 

Detailed Description

Interface for producing different kinds of graphs.

The graphs are based on data queried from the database.

@license GPL-2.0-or-later

Since
2010.07

Definition at line 16 of file TranslationStatsInterface.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface::__construct ( TranslationStatsGraphOptions $opts)

Constructor.

The implementation can access the graph options, but not define new ones.

Parameters
TranslationStatsGraphOptions$opts

Implemented in MediaWiki\Extension\Translate\Statistics\TranslatePerLanguageStats, and MediaWiki\Extension\Translate\Statistics\TranslationStatsBase.

Member Function Documentation

◆ getDateFormat()

MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface::getDateFormat ( )

Return time formatting string.

See also
Language::sprintfDate()
Returns
string

Implemented in MediaWiki\Extension\Translate\Statistics\TranslationStatsBase.

◆ getTimestamp()

MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface::getTimestamp ( $row)

Return the timestamp associated with this result row.

Parameters
stdClass$rowDatabase Result Row
Returns
string Timestamp.

Implemented in MediaWiki\Extension\Translate\Statistics\ReviewPerLanguageStats, MediaWiki\Extension\Translate\Statistics\TranslatePerLanguageStats, and MediaWiki\Extension\Translate\Statistics\TranslateRegistrationStats.

◆ indexOf()

MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface::indexOf ( $row)

Return the indexes which this result contributes to.

Return 'all' if only one variable is measured. Return false if none.

Parameters
stdClass$rowDatabase Result Row
Returns
array|false

Implemented in MediaWiki\Extension\Translate\Statistics\ReviewPerLanguageStats, MediaWiki\Extension\Translate\Statistics\TranslatePerLanguageStats, and MediaWiki\Extension\Translate\Statistics\TranslationStatsBase.

◆ labels()

MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface::labels ( )

Return the names of the variables being measured.

Return 'all' if only one variable is measured. Must match indexes returned by indexOf() and contain them all.

Returns
string[]

Implemented in MediaWiki\Extension\Translate\Statistics\ReviewPerLanguageStats, MediaWiki\Extension\Translate\Statistics\TranslatePerLanguageStats, and MediaWiki\Extension\Translate\Statistics\TranslationStatsBase.

◆ preQuery()

MediaWiki\Extension\Translate\Statistics\TranslationStatsInterface::preQuery ( & $tables,
& $fields,
& $conds,
& $type,
& $options,
& $joins,
$start,
$end )

Query details that the graph must fill.

Parameters
array&$tablesEmpty list. Append table names.
array&$fieldsEmpty list. Append field names.
array&$condsEmpty array. Append select conditions.
string&$typeAppend graph type (used to identify queries).
array&$optionsEmpty array. Append extra query options.
array&$joinsEmpty array. Append extra join conditions.
string$startPrecalculated start cutoff timestamp
string$endPrecalculated end cutoff timestamp

Implemented in MediaWiki\Extension\Translate\Statistics\ReviewPerLanguageStats, MediaWiki\Extension\Translate\Statistics\TranslatePerLanguageStats, and MediaWiki\Extension\Translate\Statistics\TranslateRegistrationStats.


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