@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | if ($this->lnk === null) { |
39 | 39 | $this->lnk = new \mysqli( |
40 | - (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '') . |
|
40 | + (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : ''). |
|
41 | 41 | $this->connection['host'], |
42 | 42 | $this->connection['user'], |
43 | 43 | $this->connection['pass'], |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | if ($temp) { |
30 | 30 | $temp = $temp->fetch_fields(); |
31 | 31 | if ($temp) { |
32 | - $columns = array_map(function ($v) { |
|
32 | + $columns = array_map(function($v) { |
|
33 | 33 | return $v->name; |
34 | 34 | }, $temp); |
35 | 35 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | public function current() |
72 | 72 | { |
73 | - return $this->nativeDriver ? $this->last : array_map(function ($v) { |
|
73 | + return $this->nativeDriver ? $this->last : array_map(function($v) { |
|
74 | 74 | return $v; |
75 | 75 | }, $this->row); |
76 | 76 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | public function next() |
91 | 91 | { |
92 | - $this->fetched ++; |
|
92 | + $this->fetched++; |
|
93 | 93 | $this->last = $this->nativeDriver ? $this->result->fetch_assoc() : $this->statement->fetch(); |
94 | 94 | } |
95 | 95 | public function valid() |
@@ -47,8 +47,7 @@ |
||
47 | 47 | if (isset($this->definition->getRelations()[$method])) { |
48 | 48 | if (array_key_exists($method, $this->fetched)) { |
49 | 49 | return is_callable($this->fetched[$method]) ? |
50 | - $this->fetched[$method] = call_user_func($this->fetched[$method], $args[0] ?? null) : |
|
51 | - $this->fetched[$method]; |
|
50 | + $this->fetched[$method] = call_user_func($this->fetched[$method], $args[0] ?? null) : $this->fetched[$method]; |
|
52 | 51 | } |
53 | 52 | } |
54 | 53 | return null; |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } |
84 | 84 | } |
85 | 85 | if (!$this->statement->execute()) { |
86 | - throw new DBException('Prepared execute error: ' . $this->statement->error); |
|
86 | + throw new DBException('Prepared execute error: '.$this->statement->error); |
|
87 | 87 | } |
88 | 88 | return new Result($this->statement, $buff); |
89 | 89 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $connection['pass'] = isset($temp['pass']) && strlen($temp['pass']) ? $temp['pass'] : null; |
75 | 75 | $connection['host'] = isset($temp['host']) && strlen($temp['host']) ? $temp['host'] : null; |
76 | 76 | $connection['name'] = isset($temp['path']) && strlen($temp['path']) ? trim($temp['path'], '/') : null; |
77 | - $connection['port'] = isset($temp['port']) && (int)$temp['port'] ? (int)$temp['port'] : null; |
|
77 | + $connection['port'] = isset($temp['port']) && (int) $temp['port'] ? (int) $temp['port'] : null; |
|
78 | 78 | if (isset($temp['query']) && strlen($temp['query'])) { |
79 | 79 | parse_str($temp['query'], $connection['opts']); |
80 | 80 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $new = ''; |
118 | 118 | $par = array_values($par); |
119 | 119 | if (substr_count($sql, '?') === 2 && !is_array($par[0])) { |
120 | - $par = [ $par ]; |
|
120 | + $par = [$par]; |
|
121 | 121 | } |
122 | 122 | $parts = explode('??', $sql); |
123 | 123 | $index = 0; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $index += count($tmp) - 1; |
128 | 128 | if (isset($par[$index])) { |
129 | 129 | if (!is_array($par[$index])) { |
130 | - $par[$index] = [ $par[$index] ]; |
|
130 | + $par[$index] = [$par[$index]]; |
|
131 | 131 | } |
132 | 132 | $params = $par[$index]; |
133 | 133 | array_splice($par, $index, 1, $params); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $new .= implode(',', array_fill(0, count($params), '?')); |
136 | 136 | } |
137 | 137 | } |
138 | - return [ $new, $par ]; |
|
138 | + return [$new, $par]; |
|
139 | 139 | } |
140 | 140 | /** |
141 | 141 | * Run a query (prepare & execute). |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | ): Collection { |
185 | 185 | $coll = Collection::from($this->query($sql, $par, $buff)); |
186 | 186 | if (($keys = $this->driver->option('mode')) && in_array($keys, ['strtoupper', 'strtolower'])) { |
187 | - $coll->map(function ($v) use ($keys) { |
|
187 | + $coll->map(function($v) use ($keys) { |
|
188 | 188 | $new = []; |
189 | 189 | foreach ($v as $k => $vv) { |
190 | 190 | $new[call_user_func($keys, $k)] = $vv; |
@@ -193,18 +193,18 @@ discard block |
||
193 | 193 | }); |
194 | 194 | } |
195 | 195 | if ($key !== null) { |
196 | - $coll->mapKey(function ($v) use ($key) { |
|
196 | + $coll->mapKey(function($v) use ($key) { |
|
197 | 197 | return $v[$key]; |
198 | 198 | }); |
199 | 199 | } |
200 | 200 | if ($skip) { |
201 | - $coll->map(function ($v) use ($key) { |
|
201 | + $coll->map(function($v) use ($key) { |
|
202 | 202 | unset($v[$key]); |
203 | 203 | return $v; |
204 | 204 | }); |
205 | 205 | } |
206 | 206 | if ($opti) { |
207 | - $coll->map(function ($v) { |
|
207 | + $coll->map(function($v) { |
|
208 | 208 | return count($v) === 1 ? current($v) : $v; |
209 | 209 | }); |
210 | 210 | } |
@@ -299,8 +299,7 @@ discard block |
||
299 | 299 | public function definition(string $table, bool $detectRelations = true) : Table |
300 | 300 | { |
301 | 301 | return isset($this->tables[$table]) ? |
302 | - $this->tables[$table] : |
|
303 | - $this->driver->table($table, $detectRelations); |
|
302 | + $this->tables[$table] : $this->driver->table($table, $detectRelations); |
|
304 | 303 | } |
305 | 304 | /** |
306 | 305 | * Parse all tables from the database. |
@@ -317,13 +316,13 @@ discard block |
||
317 | 316 | */ |
318 | 317 | public function getSchema($asPlainArray = true) |
319 | 318 | { |
320 | - return !$asPlainArray ? $this->tables : array_map(function ($table) { |
|
319 | + return !$asPlainArray ? $this->tables : array_map(function($table) { |
|
321 | 320 | return [ |
322 | 321 | 'name' => $table->getName(), |
323 | 322 | 'schema' => $table->getSchema(), |
324 | 323 | 'pkey' => $table->getPrimaryKey(), |
325 | 324 | 'comment' => $table->getComment(), |
326 | - 'columns' => array_map(function ($column) { |
|
325 | + 'columns' => array_map(function($column) { |
|
327 | 326 | return [ |
328 | 327 | 'name' => $column->getName(), |
329 | 328 | 'type' => $column->getType(), |
@@ -334,9 +333,9 @@ discard block |
||
334 | 333 | 'nullable' => $column->isNullable() |
335 | 334 | ]; |
336 | 335 | }, $table->getFullColumns()), |
337 | - 'relations' => array_map(function ($rel) { |
|
336 | + 'relations' => array_map(function($rel) { |
|
338 | 337 | $relation = clone $rel; |
339 | - $relation = (array)$relation; |
|
338 | + $relation = (array) $relation; |
|
340 | 339 | $relation['table'] = $rel->table->getName(); |
341 | 340 | if ($rel->pivot) { |
342 | 341 | $relation['pivot'] = $rel->pivot->getName(); |
@@ -389,8 +388,7 @@ discard block |
||
389 | 388 | public function table(string $table, bool $mapped = false) |
390 | 389 | { |
391 | 390 | return $mapped ? |
392 | - new TableQueryMapped($this, $this->definition($table)) : |
|
393 | - new TableQuery($this, $this->definition($table)); |
|
391 | + new TableQueryMapped($this, $this->definition($table)) : new TableQuery($this, $this->definition($table)); |
|
394 | 392 | } |
395 | 393 | public function __call($method, $args) |
396 | 394 | { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function collection(TableQueryIterator $iterator, Table $definition) : Collection |
53 | 53 | { |
54 | 54 | return Collection::from($iterator) |
55 | - ->map(function ($v) use ($definition) { |
|
55 | + ->map(function($v) use ($definition) { |
|
56 | 56 | return $this->entity($definition, $v); |
57 | 57 | }); |
58 | 58 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $definition = $entity->definition(); |
128 | 128 | foreach ($definition->getColumns() as $column) { |
129 | 129 | if (!array_key_exists($column, $data)) { |
130 | - $entity->__lazyProperty($column, function () use ($definition, $primary, $column) { |
|
130 | + $entity->__lazyProperty($column, function() use ($definition, $primary, $column) { |
|
131 | 131 | $query = $this->db->table($definition->getFullName()); |
132 | 132 | foreach ($primary as $k => $v) { |
133 | 133 | $query->filter($k, $v); |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | $name, |
142 | 142 | array_key_exists($name, $data) && isset($data[$name]) ? |
143 | 143 | ($relation->many ? |
144 | - array_map(function ($v) use ($relation) { |
|
144 | + array_map(function($v) use ($relation) { |
|
145 | 145 | return $this->entity($relation->table, $v); |
146 | 146 | }, $data[$name]) : |
147 | 147 | $this->entity($relation->table, $data[$name]) |
148 | 148 | ) : |
149 | - function (array $columns = null) use ($entity, $definition, $relation, $data) { |
|
149 | + function(array $columns = null) use ($entity, $definition, $relation, $data) { |
|
150 | 150 | $query = $this->db->table($relation->table->getFullName(), true); |
151 | 151 | if ($columns !== null) { |
152 | 152 | $query->columns($columns); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | ); |
173 | 173 | } |
174 | 174 | foreach ($definition->getPrimaryKey() as $v) { |
175 | - $query->filter($nm . '.' . $v, $data[$v] ?? null); |
|
175 | + $query->filter($nm.'.'.$v, $data[$v] ?? null); |
|
176 | 176 | } |
177 | 177 | } else { |
178 | 178 | foreach ($relation->keymap as $k => $v) { |
@@ -180,8 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | } |
182 | 182 | return $relation->many ? |
183 | - $query->iterator() : |
|
184 | - $query[0]; |
|
183 | + $query->iterator() : $query[0]; |
|
185 | 184 | } |
186 | 185 | ); |
187 | 186 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | public function affected() : int |
25 | 25 | { |
26 | - return (int)\oci_num_rows($this->statement); |
|
26 | + return (int) \oci_num_rows($this->statement); |
|
27 | 27 | } |
28 | 28 | public function insertID(string $sequence = null) |
29 | 29 | { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | public function next() |
66 | 66 | { |
67 | - $this->fetched ++; |
|
67 | + $this->fetched++; |
|
68 | 68 | $this->last = \oci_fetch_array($this->statement, \OCI_ASSOC + \OCI_RETURN_NULLS + \OCI_RETURN_LOBS); |
69 | 69 | } |
70 | 70 | public function valid() |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | $temp = @\pg_query( |
37 | 37 | $this->driver, |
38 | 38 | $sequence ? |
39 | - 'SELECT currval('.@\pg_escape_string($this->driver, $sequence).')' : |
|
40 | - 'SELECT lastval()' |
|
39 | + 'SELECT currval('.@\pg_escape_string($this->driver, $sequence).')' : 'SELECT lastval()' |
|
41 | 40 | ); |
42 | 41 | if ($temp) { |
43 | 42 | $res = \pg_fetch_row($temp); |
@@ -75,7 +74,7 @@ discard block |
||
75 | 74 | } |
76 | 75 | public function next() |
77 | 76 | { |
78 | - $this->fetched ++; |
|
77 | + $this->fetched++; |
|
79 | 78 | $this->last = \pg_fetch_array($this->statement, null, \PGSQL_ASSOC); |
80 | 79 | } |
81 | 80 | public function valid() |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | $table = $temp[1]; |
29 | 29 | } |
30 | 30 | |
31 | - if (isset($tables[$schema . '.' . $table])) { |
|
32 | - return $tables[$schema . '.' . $table]; |
|
31 | + if (isset($tables[$schema.'.'.$table])) { |
|
32 | + return $tables[$schema.'.'.$table]; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | static $comments = []; |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | $comments[$schema] = Collection::from( |
38 | 38 | $this->query( |
39 | 39 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?", |
40 | - [ $schema ] |
|
40 | + [$schema] |
|
41 | 41 | ) |
42 | 42 | ) |
43 | - ->mapKey(function ($v) { |
|
43 | + ->mapKey(function($v) { |
|
44 | 44 | return $v['TABLE_NAME']; |
45 | 45 | }) |
46 | 46 | ->pluck('TABLE_COMMENT') |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | WHERE |
61 | 61 | (TABLE_SCHEMA = ? OR REFERENCED_TABLE_SCHEMA = ?) AND |
62 | 62 | TABLE_NAME IS NOT NULL AND REFERENCED_TABLE_NAME IS NOT NULL", |
63 | - [ $main, $main ] |
|
63 | + [$main, $main] |
|
64 | 64 | ) |
65 | 65 | )->toArray(); |
66 | 66 | foreach ($col as $row) { |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | if ($row['REFERENCED_TABLE_SCHEMA'] !== $main) { |
71 | 71 | $additional[] = $row['REFERENCED_TABLE_SCHEMA']; |
72 | 72 | } |
73 | - $relationsT[$row['TABLE_SCHEMA'] . '.' . $row['TABLE_NAME']][] = $row; |
|
74 | - $relationsR[$row['REFERENCED_TABLE_SCHEMA'] . '.' . $row['REFERENCED_TABLE_NAME']][] = $row; |
|
73 | + $relationsT[$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME']][] = $row; |
|
74 | + $relationsR[$row['REFERENCED_TABLE_SCHEMA'].'.'.$row['REFERENCED_TABLE_NAME']][] = $row; |
|
75 | 75 | } |
76 | 76 | foreach (array_filter(array_unique($additional)) as $s) { |
77 | 77 | $col = Collection::from( |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | WHERE |
82 | 82 | TABLE_SCHEMA = ? AND REFERENCED_TABLE_SCHEMA = ? AND |
83 | 83 | TABLE_NAME IS NOT NULL AND REFERENCED_TABLE_NAME IS NOT NULL", |
84 | - [ $s, $s ] |
|
84 | + [$s, $s] |
|
85 | 85 | ) |
86 | 86 | )->toArray(); |
87 | 87 | foreach ($col as $row) { |
88 | - $relationsT[$row['TABLE_SCHEMA'] . '.' . $row['TABLE_NAME']][] = $row; |
|
89 | - $relationsR[$row['REFERENCED_TABLE_SCHEMA'] . '.' . $row['REFERENCED_TABLE_NAME']][] = $row; |
|
88 | + $relationsT[$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME']][] = $row; |
|
89 | + $relationsR[$row['REFERENCED_TABLE_SCHEMA'].'.'.$row['REFERENCED_TABLE_NAME']][] = $row; |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | if (!count($columns)) { |
96 | 96 | throw new DBException('Table not found by name'); |
97 | 97 | } |
98 | - $tables[$schema . '.' . $table] = $definition = (new Table($table, $schema)) |
|
98 | + $tables[$schema.'.'.$table] = $definition = (new Table($table, $schema)) |
|
99 | 99 | ->addColumns( |
100 | 100 | $columns |
101 | 101 | ->clone() |
102 | - ->mapKey(function ($v) { |
|
102 | + ->mapKey(function($v) { |
|
103 | 103 | return $v['Field']; |
104 | 104 | }) |
105 | - ->map(function ($v) { |
|
105 | + ->map(function($v) { |
|
106 | 106 | $v['length'] = null; |
107 | 107 | if (!isset($v['Type'])) { |
108 | 108 | return $v; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | default: |
125 | 125 | if (strpos($type, 'char') !== false && strpos($type, '(') !== false) { |
126 | 126 | // extract length from varchar |
127 | - $v['length'] = (int)explode(')', explode('(', $type)[1])[0]; |
|
127 | + $v['length'] = (int) explode(')', explode('(', $type)[1])[0]; |
|
128 | 128 | $v['length'] = $v['length'] > 0 ? $v['length'] : null; |
129 | 129 | } |
130 | 130 | break; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | ->setPrimaryKey( |
137 | 137 | $columns |
138 | 138 | ->clone() |
139 | - ->filter(function ($v) { |
|
139 | + ->filter(function($v) { |
|
140 | 140 | return $v['Key'] === 'PRI'; |
141 | 141 | }) |
142 | 142 | ->pluck('Field') |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | // assuming current table is on the "one" end having "many" records in the referencing table |
150 | 150 | // resulting in a "hasMany" or "manyToMany" relationship (if a pivot table is detected) |
151 | 151 | $relations = []; |
152 | - foreach ($relationsR[$schema . '.' . $table] ?? [] as $relation) { |
|
153 | - $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_SCHEMA'] . '.' . $relation['TABLE_NAME']; |
|
152 | + foreach ($relationsR[$schema.'.'.$table] ?? [] as $relation) { |
|
153 | + $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_SCHEMA'].'.'.$relation['TABLE_NAME']; |
|
154 | 154 | $relations[$relation['CONSTRAINT_NAME']]['keymap'][$relation['REFERENCED_COLUMN_NAME']] = |
155 | 155 | $relation['COLUMN_NAME']; |
156 | 156 | } |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | $usedcol = []; |
167 | 167 | if (count($columns)) { |
168 | 168 | foreach (Collection::from($relationsT[$data['table']] ?? []) |
169 | - ->filter(function ($v) use ($columns) { |
|
169 | + ->filter(function($v) use ($columns) { |
|
170 | 170 | return in_array($v['COLUMN_NAME'], $columns); |
171 | 171 | }) |
172 | - ->map(function ($v) { |
|
172 | + ->map(function($v) { |
|
173 | 173 | $new = []; |
174 | 174 | foreach ($v as $kk => $vv) { |
175 | 175 | $new[strtoupper($kk)] = $vv; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | return $new; |
178 | 178 | }) as $relation |
179 | 179 | ) { |
180 | - $foreign[$relation['CONSTRAINT_NAME']]['table'] = $relation['REFERENCED_TABLE_SCHEMA'] . '.' . $relation['REFERENCED_TABLE_NAME']; |
|
180 | + $foreign[$relation['CONSTRAINT_NAME']]['table'] = $relation['REFERENCED_TABLE_SCHEMA'].'.'.$relation['REFERENCED_TABLE_NAME']; |
|
181 | 181 | $foreign[$relation['CONSTRAINT_NAME']]['keymap'][$relation['COLUMN_NAME']] = |
182 | 182 | $relation['REFERENCED_COLUMN_NAME']; |
183 | 183 | $usedcol[] = $relation['COLUMN_NAME']; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $orig = $relname; |
194 | 194 | $cntr = 1; |
195 | 195 | while ($definition->hasRelation($relname) || $definition->getName() == $relname) { |
196 | - $relname = $orig . '_' . (++ $cntr); |
|
196 | + $relname = $orig.'_'.(++$cntr); |
|
197 | 197 | } |
198 | 198 | $definition->addRelation( |
199 | 199 | new TableRelation( |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $orig = $relname; |
215 | 215 | $cntr = 1; |
216 | 216 | while ($definition->hasRelation($relname) || $definition->getName() == $relname) { |
217 | - $relname = $orig . '_' . (++ $cntr); |
|
217 | + $relname = $orig.'_'.(++$cntr); |
|
218 | 218 | } |
219 | 219 | $definition->addRelation( |
220 | 220 | new TableRelation( |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | // assuming current table is linked to "one" record in the referenced table |
231 | 231 | // resulting in a "belongsTo" relationship |
232 | 232 | $relations = []; |
233 | - foreach (Collection::from($relationsT[$schema . '.' . $table] ?? []) |
|
234 | - ->map(function ($v) { |
|
233 | + foreach (Collection::from($relationsT[$schema.'.'.$table] ?? []) |
|
234 | + ->map(function($v) { |
|
235 | 235 | $new = []; |
236 | 236 | foreach ($v as $kk => $vv) { |
237 | 237 | $new[strtoupper($kk)] = $vv; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | return $new; |
240 | 240 | }) as $relation |
241 | 241 | ) { |
242 | - $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['REFERENCED_TABLE_SCHEMA'] . '.' . $relation['REFERENCED_TABLE_NAME']; |
|
242 | + $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['REFERENCED_TABLE_SCHEMA'].'.'.$relation['REFERENCED_TABLE_NAME']; |
|
243 | 243 | $relations[$relation['CONSTRAINT_NAME']]['keymap'][$relation['COLUMN_NAME']] = |
244 | 244 | $relation['REFERENCED_COLUMN_NAME']; |
245 | 245 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $orig = $relname; |
253 | 253 | $cntr = 1; |
254 | 254 | while ($definition->hasRelation($relname) || $definition->getName() == $relname) { |
255 | - $relname = $orig . '_' . (++ $cntr); |
|
255 | + $relname = $orig.'_'.(++$cntr); |
|
256 | 256 | } |
257 | 257 | $definition->addRelation( |
258 | 258 | new TableRelation( |
@@ -273,18 +273,18 @@ discard block |
||
273 | 273 | "SELECT table_name FROM information_schema.tables where table_schema = ?", |
274 | 274 | [$this->connection['opts']['schema'] ?? $this->connection['name']] |
275 | 275 | )) |
276 | - ->map(function ($v) { |
|
276 | + ->map(function($v) { |
|
277 | 277 | $new = []; |
278 | 278 | foreach ($v as $kk => $vv) { |
279 | 279 | $new[strtoupper($kk)] = $vv; |
280 | 280 | } |
281 | 281 | return $new; |
282 | 282 | }) |
283 | - ->mapKey(function ($v) { |
|
283 | + ->mapKey(function($v) { |
|
284 | 284 | return $v['TABLE_NAME']; |
285 | 285 | }) |
286 | 286 | ->pluck('TABLE_NAME') |
287 | - ->map(function ($v) { |
|
287 | + ->map(function($v) { |
|
288 | 288 | return $this->table($v); |
289 | 289 | }) |
290 | 290 | ->toArray(); |