wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/includes/Search/Fields/WikibaseNumericField.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Wikibase\Repo\Search\Fields;

use SearchEngine;

/**
 * Generic numeric field.
 *
 * @license GPL-2.0-or-later
 * @author Stas Malyshev
 */
abstract class WikibaseNumericField implements WikibaseIndexField {

    /**
     * @param SearchEngine $engine
     * @param string $name
     *
     * @return \SearchIndexField
     */
    public function getMappingField( SearchEngine $engine, $name ) {
        return $engine->makeSearchFieldMapping(
            $name,
            \SearchIndexField::INDEX_TYPE_INTEGER
        );
    }

}