MediaWiki master
MediaWiki\CommentStore\CommentStoreComment Class Reference

Value object for a comment stored by CommentStore. More...

Collaboration diagram for MediaWiki\CommentStore\CommentStoreComment:

Public Member Functions

 __construct ( $id, string $text, ?Message $message=null, ?array $data=null)
 

Static Public Member Functions

static newUnsavedComment ( $comment, ?array $data=null)
 Create a new, unsaved CommentStoreComment.
 

Public Attributes

array null $data
 Structured data of the comment.
 
int null $id
 Comment ID, if any.
 
Message $message
 Message version of the comment.
 
string $text
 Text version of the comment.
 

Detailed Description

Value object for a comment stored by CommentStore.

The fields should be considered read-only.

Since
1.30

Definition at line 36 of file CommentStoreComment.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\CommentStore\CommentStoreComment::__construct ( $id,
string $text,
?Message $message = null,
?array $data = null )
Access: internal
For use by CommentStore only. Use self::newUnsavedComment() instead.
Parameters
int | null$id
string$text
Message | null$message
array | null$data

Definition at line 57 of file CommentStoreComment.php.

References MediaWiki\CommentStore\CommentStoreComment\$data, MediaWiki\CommentStore\CommentStoreComment\$id, MediaWiki\CommentStore\CommentStoreComment\$message, MediaWiki\CommentStore\CommentStoreComment\$text, and MediaWiki\Message\Message\plaintextParam().

Member Function Documentation

◆ newUnsavedComment()

static MediaWiki\CommentStore\CommentStoreComment::newUnsavedComment ( $comment,
?array $data = null )
static

Create a new, unsaved CommentStoreComment.

Parameters
string | Message | CommentStoreComment$commentComment text or Message object. A CommentStoreComment is also accepted here, in which case it is returned unchanged.
array | null$dataStructured data to store. Keys beginning with '_' are reserved. Ignored if $comment is a CommentStoreComment.
Returns
CommentStoreComment

Definition at line 77 of file CommentStoreComment.php.

References MediaWiki\CommentStore\CommentStoreComment\$data, MediaWiki\CommentStore\CommentStoreComment\$message, MediaWiki\CommentStore\CommentStoreComment\$text, MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Message\Message\inLanguage().

Referenced by MediaWiki\CommentStore\CommentStore\createComment().

Member Data Documentation

◆ $data

array null MediaWiki\CommentStore\CommentStoreComment::$data

◆ $id

int null MediaWiki\CommentStore\CommentStoreComment::$id

Comment ID, if any.

Definition at line 39 of file CommentStoreComment.php.

Referenced by MediaWiki\CommentStore\CommentStoreComment\__construct().

◆ $message

Message MediaWiki\CommentStore\CommentStoreComment::$message

Message version of the comment.

Might be a RawMessage

Definition at line 45 of file CommentStoreComment.php.

Referenced by MediaWiki\CommentStore\CommentStoreComment\__construct(), and MediaWiki\CommentStore\CommentStoreComment\newUnsavedComment().

◆ $text

string MediaWiki\CommentStore\CommentStoreComment::$text

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