Page MenuHomePhabricator
Paste P10672

(An Untitled Masterwork)
ActivePublic

Authored by Addshore on Tue, Mar 10, 8:41 AM.
<?php
// TODO in namespace namespace Wikibase\Repo\FederatedProperties; ?
namespace Wikibase\Repo\Api;
use Wikibase\Repo\FederatedProperties\GenericActionApiClient;
class ApiEntitySearchHelper implements EntitySearchHelper {
/**
* @var GenericActionApiClient
* @todo inject me
*/
private $api;
/**
* @inheritDoc
*/
public function getRankedSearchResults( $text, $languageCode, $entityType, $limit, $strictLanguage ) {
// https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentities
$params = [
'search' => $text,
'language' => $languageCode,
'type' => $entityType,
'limit' => $limit,
'strictlanguage' => $strictLanguage,
];
$result = $this->api->get($params);
// TODO make an array of TermSearchResult objects from $result
}
}

Event Timeline

Addshore created this paste.Tue, Mar 10, 8:41 AM