64 parent::__construct( $title, $slots, $wikiId );
65 Assert::parameterType(
'object', $row,
'$row' );
67 $this->mId = intval( $row->rev_id );
68 $this->mPageId = intval( $row->rev_page );
69 $this->mComment = $comment;
71 $timestamp =
wfTimestamp( TS_MW, $row->rev_timestamp );
72 Assert::parameter( is_string( $timestamp ),
'$row->rev_timestamp',
'must be a valid timestamp' );
75 $this->mMinorEdit = boolval( $row->rev_minor_edit );
76 $this->mTimestamp = $timestamp;
77 $this->mDeleted = intval( $row->rev_deleted );
82 $this->mParentId = isset( $row->rev_parent_id ) ? intval( $row->rev_parent_id ) :
null;
83 $this->mSize = isset( $row->rev_len ) ? intval( $row->rev_len ) :
null;
84 $this->mSha1 = !empty( $row->rev_sha1 ) ? $row->rev_sha1 :
null;
90 if ( isset( $row->page_latest ) ) {
91 $this->mCurrent = ( $row->rev_id == $row->page_latest );
96 $this->mPageId && $this->mTitle->exists()
97 && $this->mPageId !== $this->mTitle->getArticleID()
99 throw new InvalidArgumentException(
100 'The given Title does not belong to page ID ' . $this->mPageId .
101 ' but actually belongs to ' . $this->mTitle->getArticleID()