Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| LemmaSpellingVariantsField | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| getFieldData | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Wikibase\Lexeme\Search\Elastic; |
| 4 | |
| 5 | use Wikibase\DataModel\Entity\EntityDocument; |
| 6 | use Wikibase\Lexeme\Domain\Model\Lexeme; |
| 7 | |
| 8 | class LemmaSpellingVariantsField extends LexemeKeywordField { |
| 9 | public const NAME = 'lemma_spelling_variants'; |
| 10 | |
| 11 | /** |
| 12 | * @inheritDoc |
| 13 | */ |
| 14 | public function getFieldData( EntityDocument $entity ) { |
| 15 | if ( !$entity instanceof Lexeme ) { |
| 16 | return []; |
| 17 | } |
| 18 | return array_keys( $entity->getLemmas()->toTextArray() ); |
| 19 | } |
| 20 | } |