| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Storage\Hook; |
| 4 | |
| 5 | use MediaWiki\CommentStore\CommentStoreComment; |
| 6 | use MediaWiki\Revision\RenderedRevision; |
| 7 | use MediaWiki\Status\Status; |
| 8 | use MediaWiki\User\UserIdentity; |
| 9 | |
| 10 | /** |
| 11 | * This is a hook handler interface, see docs/Hooks.md. |
| 12 | * Use the hook name "MultiContentSave" to register handlers implementing this interface. |
| 13 | * |
| 14 | * @stable to implement |
| 15 | * @ingroup Hooks |
| 16 | */ |
| 17 | interface MultiContentSaveHook { |
| 18 | /** |
| 19 | * This hook is called before an article is saved. |
| 20 | * |
| 21 | * @since 1.35 |
| 22 | * |
| 23 | * @param RenderedRevision $renderedRevision Planned revision. |
| 24 | * Provides access to: (1) ParserOutput of all slots, |
| 25 | * (2) RevisionRecord, which contains |
| 26 | * (2a) Title of the page that will be edited, |
| 27 | * (2b) RevisionSlots - content of all slots, including inherited slots, |
| 28 | * where content has already been modified by PreSaveTransform. |
| 29 | * NOTE: because this revision is not yet saved, slots don't have content ID |
| 30 | * or address, and revision itself doesn't have an ID. |
| 31 | * @param UserIdentity $user Author of this new revision |
| 32 | * @param CommentStoreComment $summary User-provided edit comment/summary |
| 33 | * (not an autosummary: will be empty if the user hasn't provided a comment) |
| 34 | * @param int $flags Combination of EDIT_* flags, e.g. EDIT_MINOR |
| 35 | * @param Status $status If the hook is aborted, error code can be placed into this Status |
| 36 | * @return bool|void True or no return value to continue or false to abort |
| 37 | */ |
| 38 | public function onMultiContentSave( $renderedRevision, $user, $summary, $flags, |
| 39 | $status |
| 40 | ); |
| 41 | } |