|
15 | 15 | use Doctrine\Common\Annotations\FileCacheReader; |
16 | 16 | use Doctrine\Common\Util\Inflector; |
17 | 17 | use ONGR\ElasticsearchBundle\Annotation\Document; |
| 18 | +use ONGR\ElasticsearchBundle\Annotation\Inherit; |
18 | 19 | use ONGR\ElasticsearchBundle\Annotation\MultiField; |
19 | 20 | use ONGR\ElasticsearchBundle\Annotation\Property; |
| 21 | +use ONGR\ElasticsearchBundle\Annotation\Skip; |
20 | 22 | use ONGR\ElasticsearchBundle\Annotation\Suggester\AbstractSuggesterProperty; |
21 | | -use ONGR\ElasticsearchBundle\Annotation\Suggester\CompletionSuggesterProperty; |
22 | | -use ONGR\ElasticsearchBundle\Annotation\Suggester\ContextSuggesterProperty; |
23 | 23 | use ONGR\ElasticsearchBundle\Document\DocumentInterface; |
24 | 24 |
|
25 | 25 | /** |
@@ -255,7 +255,7 @@ private function getDocumentReflectionMapping(\ReflectionClass $reflectionClass) |
255 | 255 |
|
256 | 256 | /** |
257 | 257 | * Returns information about accessing properties from document. |
258 | | - * |
| 258 | + * |
259 | 259 | * @param \ReflectionClass $reflectionClass Document reflection class. |
260 | 260 | * @param array $properties Document properties. |
261 | 261 | * |
@@ -373,7 +373,7 @@ private function getInfoAboutProperty($params, $alias, $reflectionClass) |
373 | 373 | * @param \ReflectionClass $reflectionClass |
374 | 374 | * |
375 | 375 | * @return array |
376 | | - * |
| 376 | + * |
377 | 377 | * @throws \LogicException |
378 | 378 | */ |
379 | 379 | private function checkPropertyAccess($property, $methodPrefix, $reflectionClass) |
@@ -477,7 +477,7 @@ private function getDocumentParentType($namespace) |
477 | 477 | * |
478 | 478 | * @param \ReflectionClass $reflectionClass Class to read properties from. |
479 | 479 | * @param array $properties Properties to skip. |
480 | | - * @param array $flag If false exludes properties, true only includes properties. |
| 480 | + * @param bool $flag If false exludes properties, true only includes properties. |
481 | 481 | * |
482 | 482 | * @return array |
483 | 483 | */ |
@@ -522,6 +522,13 @@ private function getProperties(\ReflectionClass $reflectionClass, $properties = |
522 | 522 | $mapping[$type->name] = $maps; |
523 | 523 | } |
524 | 524 |
|
| 525 | + if ($parentClass = $reflectionClass->getParentClass()) { |
| 526 | + $parent_mapping = $this->getProperties(new \ReflectionClass($parentClass->getName()), $properties, $flag); |
| 527 | + if (count($parent_mapping) > 0) { |
| 528 | + $mapping = array_merge($parent_mapping, $mapping); |
| 529 | + } |
| 530 | + } |
| 531 | + |
525 | 532 | return $mapping; |
526 | 533 | } |
527 | 534 |
|
@@ -595,7 +602,7 @@ private function getNamespace($namespace) |
595 | 602 | * @param string $name |
596 | 603 | * |
597 | 604 | * @return string |
598 | | - * |
| 605 | + * |
599 | 606 | * @throws \LogicException |
600 | 607 | */ |
601 | 608 | private function getBundle($name) |
|
0 commit comments