27use InvalidArgumentException;
54 $title = Title::newFromLinkTarget(
$parent->getPageAsLinkTarget() );
57 foreach (
$parent->getSlotRoles() as $role ) {
58 $slot =
$parent->getSlot( $role, self::RAW );
59 $rev->inheritSlot( $slot );
81 parent::__construct( $title, $slots, $wikiId );
83 $this->mSlots = $slots;
90 Assert::parameterType(
'integer', $parentId,
'$parentId' );
112 throw new InvalidArgumentException(
113 'The given slot must be an unsaved, unattached one. '
114 .
'This slot is already attached to revision ' . $slot->
getRevision() .
'. '
115 .
'Use inheritSlot() instead to preserve a slot from a previous revision.'
119 $this->mSlots->setSlot( $slot );
133 $this->mSlots->inheritSlot( $parentSlot );
152 $this->mSlots->setContent( $role,
$content );
169 $this->mSlots->removeSlot( $role );
179 $update->apply( $this->mSlots );
186 $this->mComment = $comment;
199 Assert::parameterType(
'string', $sha1,
'$sha1' );
201 $this->mSha1 = $sha1;
214 Assert::parameterType(
'integer', $size,
'$size' );
216 $this->mSize = $size;
223 Assert::parameterType(
'integer', $visibility,
'$visibility' );
232 Assert::parameterType(
'string', $timestamp,
'$timestamp' );
234 $this->mTimestamp =
wfTimestamp( TS_MW, $timestamp );
241 Assert::parameterType(
'boolean', $minorEdit,
'$minorEdit' );
243 $this->mMinorEdit = $minorEdit;
258 Assert::parameterType(
'integer', $id,
'$id' );
269 $this->mUser =
$user;
276 Assert::parameterType(
'integer', $pageId,
'$pageId' );
278 if ( $this->mTitle->exists() && $pageId !== $this->mTitle->getArticleID() ) {
279 throw new InvalidArgumentException(
280 'The given Title does not belong to page ID ' . $this->mPageId
284 $this->mPageId = $pageId;
296 if ( $this->mSize ===
null ) {
297 $this->mSize = $this->mSlots->computeSize();
312 if ( $this->mSha1 ===
null ) {
313 $this->mSha1 = $this->mSlots->computeSha1();
327 return parent::getSlots();
344class_alias( MutableRevisionRecord::class,
'MediaWiki\Storage\MutableRevisionRecord' );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Represents a title within MediaWiki.
return true to allow those checks to and false if checking is done & $user
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Base interface for content objects.