| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Rest\Hook; |
| 4 | |
| 5 | /** |
| 6 | * This is a hook handler interface, see docs/Hooks.md. |
| 7 | * Use the hook name "SearchResultProvideDescription" to register handlers implementing this interface. |
| 8 | * |
| 9 | * Called by REST SearchHandler in order to allow extensions to fill the 'description' |
| 10 | * field in search results. Warning: this hook, as well as SearchResultPageIdentity interface, |
| 11 | * is under development and still unstable. |
| 12 | * |
| 13 | * @unstable |
| 14 | * @ingroup Hooks |
| 15 | */ |
| 16 | interface SearchResultProvideDescriptionHook { |
| 17 | /** |
| 18 | * This hook is called when generating search results in order to fill the 'description' |
| 19 | * field in an extension. |
| 20 | * |
| 21 | * @since 1.35 |
| 22 | * |
| 23 | * @param array $pageIdentities Array (string=>SearchResultPageIdentity) where key is pageId |
| 24 | * @param array &$descriptions Output array (string=>string|null) where key |
| 25 | * is pageId and value is either a description for given page or null |
| 26 | */ |
| 27 | public function onSearchResultProvideDescription( array $pageIdentities, &$descriptions ); |
| 28 | } |