| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Page\Hook; |
| 4 | |
| 5 | use ManualLogEntry; |
| 6 | use MediaWiki\Page\ProperPageIdentity; |
| 7 | use MediaWiki\Permissions\Authority; |
| 8 | use MediaWiki\Revision\RevisionRecord; |
| 9 | |
| 10 | /** |
| 11 | * This is a hook handler interface, see docs/Hooks.md. |
| 12 | * Use the hook name "PageUndeleteComplete" to register handlers implementing this interface. |
| 13 | * |
| 14 | * @stable to implement |
| 15 | * @ingroup Hooks |
| 16 | */ |
| 17 | interface PageUndeleteCompleteHook { |
| 18 | /** |
| 19 | * This hook is called after a page is undeleted. |
| 20 | * |
| 21 | * @since 1.40 |
| 22 | * |
| 23 | * @param ProperPageIdentity $page Page that was undeleted. |
| 24 | * @param Authority $restorer Who undeleted the page |
| 25 | * @param string $reason Reason the page was undeleted |
| 26 | * @param RevisionRecord $restoredRev Last revision of the undeleted page |
| 27 | * @param ManualLogEntry $logEntry Log entry generated by the restoration |
| 28 | * @param int $restoredRevisionCount Number of revisions restored during the deletion |
| 29 | * @param bool $created Whether the undeletion result in a page being created |
| 30 | * @param array $restoredPageIds Array of all undeleted page IDs. |
| 31 | * This will have multiple page IDs if there was more than one deleted page with the same page title. |
| 32 | * @return void This hook must not abort, it must return no value |
| 33 | */ |
| 34 | public function onPageUndeleteComplete( |
| 35 | ProperPageIdentity $page, |
| 36 | Authority $restorer, |
| 37 | string $reason, |
| 38 | RevisionRecord $restoredRev, |
| 39 | ManualLogEntry $logEntry, |
| 40 | int $restoredRevisionCount, |
| 41 | bool $created, |
| 42 | array $restoredPageIds |
| 43 | ): void; |
| 44 | } |