@@ -23,7 +23,7 @@ |
||
23 | 23 | public function updateProxy(ProxyGenerator &$proxy) |
24 | 24 | { |
25 | 25 | // In the closure, $this is the proxied database |
26 | - $callback = function ($args, $next) { |
|
26 | + $callback = function($args, $next) { |
|
27 | 27 | |
28 | 28 | // The first argument is always the sql query |
29 | 29 | $sql = $args[0]; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | foreach ($export_fields as $field=>$_title) { |
42 | 42 | $parts = explode('.', $field); |
43 | 43 | if (count($parts) < 2) continue; |
44 | - $main = implode('.', array_slice($parts,0,-1)); |
|
44 | + $main = implode('.', array_slice($parts, 0, -1)); |
|
45 | 45 | if (!in_array($main, $eager)) { |
46 | 46 | $eager[] = $main; |
47 | 47 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | $result = []; |
13 | 13 | foreach ($arr as $k => $v) { |
14 | 14 | $key = $k; |
15 | - if ($kfield!==null) { |
|
15 | + if ($kfield !== null) { |
|
16 | 16 | if (is_array($v) && isset($v[$kfield])) $key = $v[$kfield]; |
17 | 17 | elseif (is_object($v) && isset($v->$kfield)) $key = $v->$kfield; |
18 | 18 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * Replaces DataList when EagerLoading is used. Fetches data when the main query is actually executed. |
11 | 11 | * Appends related objects when a DataObject is actually created. |
12 | 12 | */ |
13 | -class EagerLoadedDataList extends DataList{ |
|
13 | +class EagerLoadedDataList extends DataList { |
|
14 | 14 | |
15 | 15 | const ID_LIMIT = 5000; |
16 | 16 | public $withList = []; |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | |
122 | 122 | $descriptor['map'] = Utils::extractField($data, $descriptor['localField']); |
123 | 123 | $uniqueIDs = array_unique($descriptor['map']); |
124 | - while(count($uniqueIDs)) { |
|
125 | - $IDsubset = array_splice($uniqueIDs,0,self::ID_LIMIT); |
|
124 | + while (count($uniqueIDs)) { |
|
125 | + $IDsubset = array_splice($uniqueIDs, 0, self::ID_LIMIT); |
|
126 | 126 | $result = DataObject::get($depClass)->filter('ID', $IDsubset); |
127 | - if (count($depSeq)>1) { |
|
127 | + if (count($depSeq) > 1) { |
|
128 | 128 | $result = $result |
129 | - ->with(implode('.', array_slice($depSeq,1))); |
|
129 | + ->with(implode('.', array_slice($depSeq, 1))); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | foreach ($result as $depRecord) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | public function eagerLoadHasMany($data, $hasManys, $withHasManys) |
143 | 143 | { |
144 | 144 | $localClass = $this->dataClass(); |
145 | - $localClassTail = basename(str_replace('\\','/', $localClass)); |
|
145 | + $localClassTail = basename(str_replace('\\', '/', $localClass)); |
|
146 | 146 | |
147 | 147 | foreach ($withHasManys as $depSeq) { |
148 | 148 | $dep = $depSeq[0]; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'map' => [], |
157 | 157 | ]; |
158 | 158 | $result = DataObject::get($depClass)->filter($depKey, $data); |
159 | - if (count($depSeq)>1) { |
|
159 | + if (count($depSeq) > 1) { |
|
160 | 160 | $result = $result |
161 | 161 | ->with(implode('.', array_slice($depSeq, 1))); |
162 | 162 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | implode(',', [$component['childField'], $component['parentField']]), |
198 | 198 | $component['join'], |
199 | 199 | [ |
200 | - $component['parentField'].' IN (' . implode(',', $data).')' |
|
200 | + $component['parentField'].' IN ('.implode(',', $data).')' |
|
201 | 201 | ] |
202 | 202 | )->execute(); |
203 | 203 | |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted)); |
215 | - if (count($depSeq)>1) { |
|
215 | + if (count($depSeq) > 1) { |
|
216 | 216 | $result = $result |
217 | - ->with(implode('.', array_slice($depSeq,1))); |
|
217 | + ->with(implode('.', array_slice($depSeq, 1))); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | foreach ($result as $depRecord) { |