wiki.techinc.nl/includes/Rest/Hook/SearchResultProvideDescriptionHook.php
Peter Ovchyn 7df7b923da rest: Add 'thumbnail' and 'description' fields to the search response
By default, core adds those fields as null to each row.
provideThumbnail and provideDescription hooks are introduced.
Extension should subscribe on the hooks to provide a thumbnail and description respectively.

Bug: T250144
Change-Id: I42c6c8ff9d887a440174af2a21c7921573b06640
2020-05-05 19:35:52 +03:00

25 lines
853 B
PHP

<?php
namespace MediaWiki\Rest\Hook;
/**
* Called by REST SearchHandler in order to allow extensions to fill the 'description'
* field in search results. Warning: this hook as well as SearchResultPageIdentity interface
* is being under development and still unstable.
*
* @unstable
* @ingroup Hooks
*/
interface SearchResultProvideDescriptionHook {
/**
* This hook is called when generating search results in order to fill the 'description'
* field in an extension.
*
* @since 1.35
*
* @param array $pageIdentities an array (string=>SearchResultPageIdentity) where key is pageId.
* @param array &$descriptions an output array (string=>string|null) where key
* is pageId and value is either a desciption for given page or null
*/
public function onSearchResultProvideDescription( array $pageIdentities, &$descriptions );
}