File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed
Tests/Functional/app/Basic Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -40,16 +40,7 @@ public function getConfiguration()
4040 {
4141 $ indexes = array ();
4242 foreach ($ this ->configArray as $ config ) {
43- $ types = array ();
44- foreach ($ config ['types ' ] as $ typeConfig ) {
45- $ types [$ typeConfig ['name ' ]] = new TypeConfig (
46- $ typeConfig ['name ' ],
47- $ typeConfig ['mapping ' ],
48- $ typeConfig ['config ' ]
49- );
50- // TODO: handle prototypes..
51- }
52-
43+ $ types = $ this ->getTypes ($ config );
5344 $ index = new IndexConfig ($ config ['name ' ], $ types , array (
5445 'elasticSearchName ' => $ config ['elasticsearch_name ' ],
5546 'settings ' => $ config ['settings ' ],
@@ -61,4 +52,28 @@ public function getConfiguration()
6152
6253 return $ indexes ;
6354 }
55+
56+ /**
57+ * Builds TypeConfig objects for each type.
58+ *
59+ * @param array $config
60+ * @return array
61+ */
62+ protected function getTypes ($ config )
63+ {
64+ $ types = array ();
65+
66+ if (isset ($ config ['types ' ])) {
67+ foreach ($ config ['types ' ] as $ typeConfig ) {
68+ $ types [$ typeConfig ['name ' ]] = new TypeConfig (
69+ $ typeConfig ['name ' ],
70+ $ typeConfig ['mapping ' ],
71+ $ typeConfig ['config ' ]
72+ );
73+ // TODO: handle prototypes..
74+ }
75+ }
76+
77+ return $ types ;
78+ }
6479}
Original file line number Diff line number Diff line change @@ -92,3 +92,4 @@ fos_elastica:
9292 identifier : " id"
9393 null_mappings :
9494 mappings : ~
95+ empty_index : ~
You can’t perform that action at this time.
0 commit comments