@@ -47,19 +47,7 @@ public function parse(Request $request, array $columnConfiguration)
4747
4848 $ this ->getRegex ($ query , $ builder );
4949
50- // for each column we need to see if there is a search value
51- foreach ($ columnConfiguration as $ i => $ c ) {
52- // check if there is something search related
53- if ($ c ->getSearch ()->isSearchable () && $ query ->has ("sSearch_ " . $ i ) && !$ this ->isEmpty ($ query ->get ("sSearch_ " . $ i ))) {
54- // search for this column is available
55- $ builder ->columnSearch ($ c ->getName (), $ query ->get ("sSearch_ " . $ i ));
56- }
57- // check if there is something order related
58- if ($ c ->getOrder ()->isOrderable () && $ query ->has ("iSortCol_ " . $ i ) && !$ this ->isEmpty ($ query ->get ("iSortCol_ " . $ i ))) {
59- // order for this column is available
60- $ builder ->columnOrder ($ c ->getName (), $ query ->get ("sSortDir_ " . $ i ));
61- }
62- }
50+ $ this ->getSearchColumns ($ query , $ builder , $ columnConfiguration );
6351
6452 return $ builder ->build ();
6553 }
@@ -118,6 +106,27 @@ public function getSearch($query, $builder)
118106 }
119107 }
120108
109+ /**
110+ * @param ParameterBag $query
111+ * @param QueryConfigurationBuilder $builder
112+ */
113+ public function getSearchColumns ($ query , $ builder , array $ columnConfiguration )
114+ {
115+ // for each column we need to see if there is a search value
116+ foreach ($ columnConfiguration as $ i => $ c ) {
117+ // check if there is something search related
118+ if ($ c ->getSearch ()->isSearchable () && $ query ->has ("sSearch_ " . $ i ) && !$ this ->isEmpty ($ query ->get ("sSearch_ " . $ i ))) {
119+ // search for this column is available
120+ $ builder ->columnSearch ($ c ->getName (), $ query ->get ("sSearch_ " . $ i ));
121+ }
122+ // check if there is something order related
123+ if ($ c ->getOrder ()->isOrderable () && $ query ->has ("iSortCol_ " . $ i ) && !$ this ->isEmpty ($ query ->get ("iSortCol_ " . $ i ))) {
124+ // order for this column is available
125+ $ builder ->columnOrder ($ c ->getName (), $ query ->get ("sSortDir_ " . $ i ));
126+ }
127+ }
128+ }
129+
121130 /**
122131 * @param ParameterBag $query
123132 * @param QueryConfigurationBuilder $builder
0 commit comments