29 use Wikimedia\Assert\Assert;
67 parent::__construct(
$title, $slots, $dbDomain );
68 Assert::parameterType(
'object', $row,
'$row' );
70 $timestamp =
wfTimestamp( TS_MW, $row->ar_timestamp );
71 Assert::parameter( is_string( $timestamp ),
'$row->rev_timestamp',
'must be a valid timestamp' );
73 $this->mArchiveId = intval( $row->ar_id );
78 $this->mPageId = isset( $row->ar_page_id ) ? intval( $row->ar_page_id ) :
$title->getArticleID();
83 $this->mParentId = isset( $row->ar_parent_id ) ? intval( $row->ar_parent_id ) :
null;
84 $this->mId = isset( $row->ar_rev_id ) ? intval( $row->ar_rev_id ) :
null;
85 $this->mComment = $comment;
87 $this->mTimestamp = $timestamp;
88 $this->mMinorEdit = boolval( $row->ar_minor_edit );
89 $this->mDeleted = intval( $row->ar_deleted );
90 $this->mSize = isset( $row->ar_len ) ? intval( $row->ar_len ) :
null;
91 $this->mSha1 = !empty( $row->ar_sha1 ) ? $row->ar_sha1 :
null;
109 return parent::getId();
119 if ( $this->mSize ===
null ) {
120 $this->mSize = $this->mSlots->computeSize();
133 if ( $this->mSha1 ===
null ) {
134 $this->mSha1 = $this->mSlots->computeSha1();
146 public function getUser( $audience = self::FOR_PUBLIC,
User $user =
null ) {
159 return parent::getComment( $audience, $user );
185 class_alias( RevisionArchiveRecord::class,
'MediaWiki\Storage\RevisionArchiveRecord' );