65 parent::__construct(
$title, $slots, $dbDomain );
66 Assert::parameterType( \stdClass::class, $row,
'$row' );
68 $this->mId = intval( $row->rev_id );
69 $this->mPageId = intval( $row->rev_page );
70 $this->mComment = $comment;
72 $timestamp = MWTimestamp::convert( TS_MW, $row->rev_timestamp );
74 is_string( $timestamp ),
75 '$row->rev_timestamp',
76 "must be a valid timestamp (rev_id={$this->mId}, rev_timestamp={$row->rev_timestamp})"
80 $this->mMinorEdit = boolval( $row->rev_minor_edit );
81 $this->mTimestamp = $timestamp;
82 $this->mDeleted = intval( $row->rev_deleted );
87 $this->mParentId = isset( $row->rev_parent_id ) ? intval( $row->rev_parent_id ) :
null;
88 $this->mSize = isset( $row->rev_len ) ? intval( $row->rev_len ) :
null;
89 $this->mSha1 = !empty( $row->rev_sha1 ) ? $row->rev_sha1 :
null;
95 if ( isset( $row->page_latest ) ) {
96 $this->mCurrent = ( $row->rev_id == $row->page_latest );
101 $this->mPageId && $this->mTitle->exists()
102 && $this->mPageId !== $this->mTitle->getArticleID()
104 throw new InvalidArgumentException(
105 'The given Title (' . $this->mTitle->getPrefixedText() .
')' .
106 ' does not belong to page ID ' . $this->mPageId .
107 ' but actually belongs to ' . $this->mTitle->getArticleID()