File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed
Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change 66
77class Processor extends SqlServerProcessor
88{
9- //
9+ /**
10+ * Process the results of an indexes query.
11+ * @param array $results
12+ * @return array
13+ */
14+ public function processIndexes ($ results )
15+ {
16+ $ array = [];
17+ $ indexes = collect ($ results )->unique ('name ' );
18+ foreach ($ indexes AS $ index )
19+ {
20+ $ aux = [];
21+ $ aux ['name ' ] = $ index ->name ;
22+ $ aux ['columns ' ] = $ this ->concatenaCampos ($ results ,$ index ->name );
23+ $ aux ['unique ' ] = $ index ->is_unique ;
24+ $ aux ['primary ' ] = $ index ->is_primary ;
25+ array_push ($ array , $ aux );
26+ }
27+ return $ array ;
28+ }
29+
30+ /**
31+ * @param $results
32+ * @param $indexName
33+ * @return array
34+ * Helper function for building index vector
35+ */
36+ public function getColumnsFromIndexResult ($ results , $ indexName )
37+ {
38+ $ columns = [];
39+ foreach ($ results AS $ result )
40+ {
41+ if ($ result ->name == $ indexName )
42+ {
43+ array_push ($ columns ,$ result ->column_name );
44+ }
45+ }
46+ return $ columns ;
47+ }
1048}
You can’t perform that action at this time.
0 commit comments