MessageHandle Class Reference

Class for pointing to messages, like Title class is for titles. More...

Inheritance diagram for MessageHandle:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct (Title $title)
 isMessageNamespace ()
 Check if this handle is in a message namespace.
 figureMessage ()
 Recommended to use getCode and getKey instead.
 getKey ()
 Returns the identified or guessed message key.
 getCode ()
 Returns the language code.
 getEffectiveLanguageCode ()
 Return the code for the assumed language of the content, which might be different from the subpage code (qqq, no subpage).
 isDoc ()
 Determine whether the current handle is for message documentation.
 isPageTranslation ()
 Determine whether the current handle is for page translation feature.
 getGroupIds ()
 Returns all message group ids this message belongs to.
 getGroup ()
 Get the primary MessageGroup this message belongs to.
 isValid ()
 Checks if the handle corresponds to a known message.
 getTitle ()
 Get the original title.
 isFuzzy ()
 Check if a title is marked as fuzzy.

Static Public Member Functions

static hasFuzzyString ($text)
 Check if a string contains the fuzzy string.

Protected Attributes

 $title = null
 $key = null
 $code = null
 $groupIds = null
 $group = false

Detailed Description

Class for pointing to messages, like Title class is for titles.

Since:
2011-03-13

Definition at line 14 of file MessageHandle.php.


Constructor & Destructor Documentation

MessageHandle::__construct ( Title $  title  ) 

Definition at line 26 of file MessageHandle.php.


Member Function Documentation

MessageHandle::figureMessage (  ) 

Recommended to use getCode and getKey instead.

Returns:
Array of the message key and the language code

Definition at line 45 of file MessageHandle.php.

Referenced by getCode(), and getKey().

Here is the call graph for this function:

MessageHandle::getCode (  ) 

Returns the language code.

For language codeless source messages will return empty string.

Returns:
String

Definition at line 80 of file MessageHandle.php.

Referenced by TranslateEditAddons::checkNeedsFuzzy(), MessageGroupStats::clear(), SolrTTMServer::createDocument(), TranslateEditAddons::figureNextPrevMessages(), getEffectiveLanguageCode(), isDoc(), MessageGroups::isTranslatableMessage(), MessageGroupStats::update(), SolrTTMServer::update(), and DatabaseTTMServer::update().

Here is the call graph for this function:

MessageHandle::getEffectiveLanguageCode (  ) 

Return the code for the assumed language of the content, which might be different from the subpage code (qqq, no subpage).

Returns:
String
Since:
2012-08-05

Definition at line 92 of file MessageHandle.php.

Here is the call graph for this function:

MessageHandle::getGroup (  ) 

Get the primary MessageGroup this message belongs to.

You should check first that the handle is valid.

Exceptions:
MWException 
Returns:
MessageGroup

Definition at line 142 of file MessageHandle.php.

Referenced by TranslateEditAddons::checkNeedsFuzzy(), TranslateEditAddons::figureNextPrevMessages(), MessageGroups::isTranslatableMessage(), isValid(), SolrTTMServer::update(), DatabaseTTMServer::update(), and TranslateEditAddons::updateTransverTag().

Here is the call graph for this function:

MessageHandle::getGroupIds (  ) 

Returns all message group ids this message belongs to.

The primary message group id is always the first one. If the handle does not correspond to any message, the returned array is empty.

Returns:
array

Reimplemented in MockMessageHandle.

Definition at line 128 of file MessageHandle.php.

Referenced by MessageGroupStats::clear(), SolrTTMServer::createDocument(), figureMessage(), getGroup(), MessageGroupStatesUpdaterJob::getGroupsWithTransitions(), isValid(), and MessageGroupStats::update().

Here is the call graph for this function:

MessageHandle::getKey (  ) 
MessageHandle::getTitle (  ) 
static MessageHandle::hasFuzzyString ( text  )  [static]

Check if a string contains the fuzzy string.

Parameters:
$text string Arbitrary text
Returns:
bool If string contains fuzzy string.

Definition at line 194 of file MessageHandle.php.

Referenced by ApiQueryMessageTranslations::execute(), TranslationAid::getTranslations(), and SpecialTranslations::showTranslations().

MessageHandle::isDoc (  ) 

Determine whether the current handle is for message documentation.

Returns:
bool

Definition at line 106 of file MessageHandle.php.

Referenced by TranslateEditAddons::checkNeedsFuzzy(), and getEffectiveLanguageCode().

Here is the call graph for this function:

MessageHandle::isFuzzy (  ) 

Check if a title is marked as fuzzy.

Returns:
bool If title is marked fuzzy.

Definition at line 202 of file MessageHandle.php.

Here is the call graph for this function:

MessageHandle::isMessageNamespace (  ) 

Check if this handle is in a message namespace.

Returns:
bool

Definition at line 34 of file MessageHandle.php.

Referenced by isValid().

Here is the call graph for this function:

MessageHandle::isPageTranslation (  ) 

Determine whether the current handle is for page translation feature.

This does not consider whether the handle corresponds to any message.

Returns:
bool

Definition at line 117 of file MessageHandle.php.

Here is the call graph for this function:

MessageHandle::isValid (  ) 

Checks if the handle corresponds to a known message.

Since:
2011-03-16
Returns:
bool

Definition at line 156 of file MessageHandle.php.

Referenced by MessageGroups::isTranslatableMessage(), SolrTTMServer::update(), and DatabaseTTMServer::update().

Here is the call graph for this function:


Member Data Documentation

MessageHandle::$code = null [protected]

Definition at line 20 of file MessageHandle.php.

Referenced by getEffectiveLanguageCode().

MessageHandle::$group = false [protected]

Definition at line 24 of file MessageHandle.php.

Referenced by isValid().

MessageHandle::$groupIds = null [protected]

Definition at line 22 of file MessageHandle.php.

MessageHandle::$key = null [protected]

Definition at line 18 of file MessageHandle.php.

MessageHandle::$title = null [protected]

Definition at line 16 of file MessageHandle.php.

Referenced by figureMessage().


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:50 2013 for MediaWiki Translate Extension by  doxygen 1.6.3