wiki.techinc.nl/includes/Rest/Entity/SearchResultPageIdentity.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

38 lines
837 B
PHP

<?php
namespace MediaWiki\Rest\Entity;
/**
* Lightweight interface representing a page identity
*
* @unstable
* @note This interface is temorary solution. It will be replaced by the one from:
* https://phabricator.wikimedia.org/T208776
*/
interface SearchResultPageIdentity {
/**
* The numerical page ID.
* At the moment it is equivalent to Title::getArticleID()
* @see Title::getArticleID()
*
* @return int
*/
function getId(): int;
/**
* Returns the page's namespace number.
* At the moment it is equivalent to Title::getNamespace()
* @see Title::getNamespace()
*
* @return int
*/
function getNamespace(): int;
/**
* Get the page title in DB key form.
* At the moment it is equivalent to Title::getDBkey()
* @see Title::getDBkey()
*
* @return string
*/
function getDBkey(): string;
}