1818use Neos \ContentRepository \Domain \Model \NodeType ;
1919use Neos \ContentRepository \Domain \Service \NodeTypeManager ;
2020use Neos \Error \Messages \Result ;
21+ use Neos \Error \Messages \Warning ;
2122use Neos \Flow \Annotations as Flow ;
2223use Neos \Flow \Configuration \ConfigurationManager ;
24+ use Neos \Flow \Configuration \Exception \InvalidConfigurationTypeException ;
25+ use Neos \Flow \ObjectManagement \ObjectManagerInterface ;
2326
2427/**
2528 * NodeTypeMappingBuilder for Elasticsearch version 1.x
@@ -41,11 +44,6 @@ class NodeTypeMappingBuilder extends AbstractNodeTypeMappingBuilder
4144 */
4245 protected $ nodeTypeManager ;
4346
44- /**
45- * @var Result
46- */
47- protected $ lastMappingErrors ;
48-
4947 /**
5048 * @Flow\Inject
5149 * @var ConfigurationManager
@@ -56,11 +54,12 @@ class NodeTypeMappingBuilder extends AbstractNodeTypeMappingBuilder
5654 * Called by the Flow object framework after creating the object and resolving all dependencies.
5755 *
5856 * @param integer $cause Creation cause
57+ * @throws InvalidConfigurationTypeException
5958 */
6059 public function initializeObject ($ cause )
6160 {
62- if ($ cause === \ Neos \ Flow \ ObjectManagement \ ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED ) {
63- $ settings = $ this ->configurationManager ->getConfiguration (\ Neos \ Flow \ Configuration \ ConfigurationManager::CONFIGURATION_TYPE_SETTINGS , 'Neos.ContentRepository.Search ' );
61+ if ($ cause === ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED ) {
62+ $ settings = $ this ->configurationManager ->getConfiguration (ConfigurationManager::CONFIGURATION_TYPE_SETTINGS , 'Neos.ContentRepository.Search ' );
6463 $ this ->defaultConfigurationPerType = $ settings ['defaultConfigurationPerType ' ];
6564 }
6665 }
@@ -126,7 +125,7 @@ public function buildMappingInformation(Index $index)
126125 $ mapping ->setPropertyByPath ($ propertyName , $ this ->defaultConfigurationPerType [$ propertyConfiguration ['type ' ]]['elasticSearchMapping ' ]);
127126 }
128127 } else {
129- $ this ->lastMappingErrors ->addWarning (new \ Neos \ Error \ Messages \ Warning ('Node Type " ' . $ nodeTypeName . '" - property " ' . $ propertyName . '": No ElasticSearch Mapping found. ' ));
128+ $ this ->lastMappingErrors ->addWarning (new Warning ('Node Type " ' . $ nodeTypeName . '" - property " ' . $ propertyName . '": No ElasticSearch Mapping found. ' ));
130129 }
131130 }
132131
@@ -135,12 +134,4 @@ public function buildMappingInformation(Index $index)
135134
136135 return $ mappings ;
137136 }
138-
139- /**
140- * @return Result
141- */
142- public function getLastMappingErrors ()
143- {
144- return $ this ->lastMappingErrors ;
145- }
146137}
0 commit comments