18 protected $definition;
24 protected $props = [];
26 protected $reviewers = [];
43 public function key() {
52 return $this->definition;
91 return in_array( $tag, $this->tags,
true );
102 public function setProperty( $key, $value ) {
103 $this->props[$key] = $value;
106 public function appendProperty( $key, $value ) {
107 if ( !isset( $this->props[$key] ) ) {
108 $this->props[$key] = [];
110 $this->props[$key][] = $value;
113 public function getProperty( $key ) {
114 return $this->props[$key] ??
null;
123 return array_keys( $this->props );
134 protected static $propertyMap = [
135 'last-translator-text' =>
'rev_user_text',
136 'last-translator-id' =>
'rev_user',
141 protected $translation;
161 if ( !isset( $this->row ) ) {
165 return $this->translation;
169 public function getProperty( $key ) {
170 if ( !isset( self::$propertyMap[$key] ) ) {
171 return parent::getProperty( $key );
174 $field = self::$propertyMap[$key];
176 return $this->row->$field ??
null;
181 return array_merge( parent::getPropertyNames(), array_keys( self::$propertyMap ) );
191 protected $translation;
203 return $this->infile;
206 return $this->translation;
Message object where you can directly set the translation.
translation()
Get the message translation.
setTranslation( $text)
Set the current translation of this message.
Interface for message objects used by MessageCollection.
definition()
Get the message definition.
hasTag( $tag)
Check if this message has a given tag.
addTag( $tag)
Add a tag for this message.
translation()
Get the message translation.
key()
Get the message key.
getPropertyNames()
Get all the available property names.
__construct( $key, $definition)
Creates new message object.
getTags()
Return all tags for this message;.
infile()
Returns the committed translation.
setInfile( $text)
Set the committed translation.
Message object which is based on database result row.
getPropertyNames()
Get all the available property names.
setTranslation( $text)
Set the current translation of this message.
setRow( $row)
Set the database row this message is based on.