31use Wikimedia\Assert\Assert;
69 parent::__construct( $page, $slots,
$wikiId );
71 $timestamp = MWTimestamp::convert( TS_MW, $row->ar_timestamp );
72 Assert::parameter( is_string( $timestamp ),
'$row->rev_timestamp',
'must be a valid timestamp' );
74 $this->mArchiveId = intval( $row->ar_id );
79 $this->mPageId = isset( $row->ar_page_id ) ? intval( $row->ar_page_id ) : $this->getArticleId( $this->mPage );
84 $this->mParentId = isset( $row->ar_parent_id ) ? intval( $row->ar_parent_id ) :
null;
85 $this->mId = isset( $row->ar_rev_id ) ? intval( $row->ar_rev_id ) :
null;
86 $this->mComment = $comment;
88 $this->mTimestamp = $timestamp;
89 $this->mMinorEdit = (bool)$row->ar_minor_edit;
90 $this->mDeleted = intval( $row->ar_deleted );
91 $this->mSize = isset( $row->ar_len ) ? intval( $row->ar_len ) :
null;
92 $this->mSha1 = !empty( $row->ar_sha1 ) ? $row->ar_sha1 :
null;
111 return parent::getId(
$wikiId );
121 $this->mSize ??= $this->mSlots->computeSize();
133 $this->mSha1 ??= $this->mSlots->computeSha1();
146 return parent::getUser( $audience, $performer );
157 return parent::getComment( $audience, $performer );
165 return parent::getTimestamp();
173 $field === self::DELETED_TEXT &&
174 !$performer->
authorizeRead(
'deletedtext', $this->getPage() ) &&
182 $field === self::DELETED_COMMENT &&
183 !$performer->
authorizeRead(
'deletedhistory', $this->getPage() )
190 return parent::userCan( $field, $performer );
197 $audience == self::FOR_PUBLIC &&
198 ( $field === self::DELETED_TEXT || $field === self::DELETED_COMMENT )
206 return parent::audienceCan( $field, $audience, $performer );
Interface for objects (potentially) representing an editable wiki page.