/** * Tests if values are dumped correctly for mapping. */ public function testDump() { $type = new Property(); $type->name = 'myprop'; $type->type = 'mytype'; $type->multilanguage = false; $type->objectName = 'foo/bar'; $type->multiple = null; $type->options = ['type' => 'this should not be set here', 'analyzer' => 'standard', 'foo' => 'bar']; $type->foo = 'bar'; $this->assertEquals(['analyzer' => 'standard', 'foo' => 'bar', 'type' => 'mytype'], $type->dump(), 'Properties should be filtered'); }
private function getPropertyMapping(Property $propertyAnnotation, $language = null, array $indexAnalyzers = []) { $propertyMapping = $propertyAnnotation->dump(['language' => $language, 'indexAnalyzers' => $indexAnalyzers]); // Object. if (in_array($propertyAnnotation->type, ['object', 'nested']) && !empty($propertyAnnotation->objectName)) { $propertyMapping = array_replace_recursive($propertyMapping, $this->getObjectMapping($propertyAnnotation->objectName, $indexAnalyzers)); } return $propertyMapping; }