| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Dummy implementation of SearchIndexFieldDefinition for testing purposes. |
| 5 | * |
| 6 | * @since 1.28 |
| 7 | */ |
| 8 | class DummySearchIndexFieldDefinition extends SearchIndexFieldDefinition { |
| 9 | |
| 10 | /** |
| 11 | * @param SearchEngine $engine |
| 12 | * |
| 13 | * @return array |
| 14 | */ |
| 15 | public function getMapping( SearchEngine $engine ) { |
| 16 | $mapping = [ |
| 17 | 'name' => $this->name, |
| 18 | 'type' => $this->type, |
| 19 | 'flags' => $this->flags, |
| 20 | 'subfields' => [] |
| 21 | ]; |
| 22 | |
| 23 | foreach ( $this->subfields as $subfield ) { |
| 24 | $mapping['subfields'][] = $subfield->getMapping( $engine ); |
| 25 | } |
| 26 | |
| 27 | return $mapping; |
| 28 | } |
| 29 | |
| 30 | } |