X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=blobdiff_plain;f=docs%2Fpageupdater.txt;h=54eb91a9e56cb75b0e3e21222682d5ce5e987b67;hb=4226fada45a83ad56e91ce7638d17d12fecec8ca;hp=4980c9242bd7efa34a708882cb486a1ac6af08b0;hpb=15f6eff90c305d405fe4331c8a8dc8caa842e5b3;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.