X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=docs%2Fpageupdater.txt;h=54eb91a9e56cb75b0e3e21222682d5ce5e987b67;hb=e1a706dbf77668428a90954de4b23d2d6682f467;hp=4980c9242bd7efa34a708882cb486a1ac6af08b0;hpb=72871eb3fb60cf61df8965347ebc77f93685dd98;p=lhc%2Fweb%2Fwiklou.git diff --git a/docs/pageupdater.txt b/docs/pageupdater.txt index 4980c9242b..54eb91a9e5 100644 --- a/docs/pageupdater.txt +++ b/docs/pageupdater.txt @@ -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.