Conditions | 4 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function accept(ReflectionClass $class, Entity $entity, $annotation): void |
||
16 | { |
||
17 | if (!($annotation instanceof Document)) { |
||
18 | return; |
||
19 | } |
||
20 | $writeIndices = $annotation->writeIndices ?: [$class->getShortName()]; |
||
21 | $readIndices = $annotation->readIndices ?: [$class->getShortName()]; |
||
22 | $target = Indexing::from($entity->getIndexing()) |
||
23 | ->setWriteIndices($writeIndices) |
||
24 | ->setReadIndices($readIndices) |
||
25 | ->setType($annotation->type); |
||
26 | $entity |
||
27 | ->setIndexing($target) |
||
28 | ->setRootLevelDocument(true); |
||
29 | } |
||
31 |