| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 1 | public function createType(string $index, string $entityClass) |
|
| 49 | { |
||
| 50 | 1 | $classMetadata = ClassMetadataVisiteeFactory::create($entityClass); |
|
| 51 | 1 | $properties = $classMetadata->accept(AnnotationVisitorFactory::getConfigVisitor()); |
|
| 52 | |||
| 53 | $indexConfig = [ |
||
| 54 | 1 | 'index' => $index, |
|
| 55 | 1 | 'type' => $entityClass, |
|
| 56 | 'body' => [ |
||
| 57 | $entityClass => [ |
||
| 58 | 1 | 'properties' => $properties, |
|
| 59 | ], |
||
| 60 | ], |
||
| 61 | ]; |
||
| 62 | |||
| 63 | 1 | return $this->client->indices()->putMapping($indexConfig); |
|
| 64 | } |
||
| 65 | } |
||
| 66 |