Merge "Allow SelectWithInput to be marked as required and handle that dynamically"
[lhc/web/wiklou.git] / docs / pageupdater.txt
index 4980c92..fd084c0 100644 (file)
@@ -61,7 +61,7 @@ Typical usage for programmatic revision creation (with $page being a WikiPage as
 replaced by a repository service later):
 
   $updater = $page->newPageUpdater( $user );
-  $updater->setContent( 'main', $content );
+  $updater->setContent( SlotRecord::MAIN, $content );
   $updater->setRcPatrolStatus( RecentChange::PRC_PATROLLED );
   $newRev = $updater->saveRevision( $comment );
 
@@ -69,8 +69,8 @@ Usage with content depending on the parent revision
 
   $updater = $page->newPageUpdater( $user );
   $parent = $updater->grabParentRevision();
-  $content = $parent->getContent( 'main' )->replaceSection( $section, $sectionContent );
-  $updater->setContent( 'main', $content );
+  $content = $parent->getContent( SlotRecord::MAIN )->replaceSection( $section, $sectionContent );
+  $updater->setContent( SlotRecord::MAIN, $content );
   $newRev = $updater->saveRevision( $comment, EDIT_UPDATE );
 
 In both cases, all secondary updates will be triggered automatically.
@@ -161,11 +161,11 @@ Calling prepareUpdate() with the same parameters again has no effect.
 Calling it again with mismatching parameters, or calling it with parameters mismatching
 the ones prepareContent() was called with, triggers a LogicException.
 
-- getSecondaryDataUpdtes() returns DataUpdates that represent derived data for the revision.
+- getSecondaryDataUpdates() returns DataUpdates that represent derived data for the revision.
 These may be used to update such data, e.g. in ApiPurge, RefreshLinksJob, and the refreshLinks
 script.
 
-- doUpdates() triggers the updates defined by getSecondaryDataUpdtes(), and also causes
+- doUpdates() triggers the updates defined by getSecondaryDataUpdates(), and also causes
 updates to cached artifacts in the ParserCache, the CDN layer, etc. This is primarily
 used by PageUpdater, but also by PageArchive during undeletion, and when importing
 revisions from XML. doUpdates() can only be called after prepareUpdate() was used to