Merge "Simplify HTMLTitleTextField::validate"
[lhc/web/wiklou.git] / docs / pageupdater.txt
index 4980c92..54eb91a 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.