@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | $foreign = $this->foreignKey; |
165 | 165 | |
166 | - return BaseCollection::make($this->dictionary[$type])->map(function ($entities) use ($foreign) { |
|
166 | + return BaseCollection::make($this->dictionary[$type])->map(function($entities) use ($foreign) { |
|
167 | 167 | return head($entities)->{$foreign}; |
168 | 168 | |
169 | 169 | })->unique(); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected function addWithTrashed(Query $query) |
75 | 75 | { |
76 | - $query->macro('withTrashed', function (Query $query) { |
|
76 | + $query->macro('withTrashed', function(Query $query) { |
|
77 | 77 | $this->remove($query); |
78 | 78 | |
79 | 79 | return $query; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | protected function addOnlyTrashed(Query $query) |
90 | 90 | { |
91 | - $query->macro('onlyTrashed', function (Query $query) { |
|
91 | + $query->macro('onlyTrashed', function(Query $query) { |
|
92 | 92 | $this->remove($query); |
93 | 93 | |
94 | 94 | $query->getQuery()->whereNotNull($query->getMapper()->getEntityMap()->getQualifiedDeletedAtColumn()); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function register() |
36 | 36 | { |
37 | - $this->app->singleton('analogue', function ($app) { |
|
37 | + $this->app->singleton('analogue', function($app) { |
|
38 | 38 | |
39 | 39 | $db = $app['db']; |
40 | 40 |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function wherePivot($column, $operator = null, $value = null, $boolean = 'and') |
147 | 147 | { |
148 | - return $this->where($this->table . '.' . $column, $operator, $value, $boolean); |
|
148 | + return $this->where($this->table.'.'.$column, $operator, $value, $boolean); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -326,11 +326,11 @@ discard block |
||
326 | 326 | |
327 | 327 | $tablePrefix = $this->query->getQuery()->getConnection()->getTablePrefix(); |
328 | 328 | |
329 | - $query->from($this->table . ' as ' . $tablePrefix . $hash = $this->getRelationCountHash()); |
|
329 | + $query->from($this->table.' as '.$tablePrefix.$hash = $this->getRelationCountHash()); |
|
330 | 330 | |
331 | 331 | $key = $this->wrap($this->getQualifiedParentKeyName()); |
332 | 332 | |
333 | - return $query->where($hash . '.' . $this->foreignKey, '=', new Expression($key)); |
|
333 | + return $query->where($hash.'.'.$this->foreignKey, '=', new Expression($key)); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function getRelationCountHash() |
342 | 342 | { |
343 | - return 'self_' . md5(microtime(true)); |
|
343 | + return 'self_'.md5(microtime(true)); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | protected function getSelectColumns(array $columns = ['*']) |
353 | 353 | { |
354 | 354 | if ($columns == ['*']) { |
355 | - $columns = [$this->relatedMap->getTable() . '.*']; |
|
355 | + $columns = [$this->relatedMap->getTable().'.*']; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | return array_merge($columns, $this->getAliasedPivotColumns()); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $columns = []; |
374 | 374 | |
375 | 375 | foreach (array_merge($defaults, $this->pivotColumns) as $column) { |
376 | - $columns[] = $this->table . '.' . $column . ' as pivot_' . $column; |
|
376 | + $columns[] = $this->table.'.'.$column.' as pivot_'.$column; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | return array_unique($columns); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | // model instance. Then we can set the "where" for the parent models. |
395 | 395 | $baseTable = $this->relatedMap->getTable(); |
396 | 396 | |
397 | - $key = $baseTable . '.' . $this->relatedMap->getKeyName(); |
|
397 | + $key = $baseTable.'.'.$this->relatedMap->getKeyName(); |
|
398 | 398 | |
399 | 399 | $query->join($this->table, $key, '=', $this->getOtherKey()); |
400 | 400 | |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | { |
753 | 753 | $keyName = $this->relatedMap->getKeyName(); |
754 | 754 | |
755 | - return array_map(function ($m) use ($keyName) { |
|
755 | + return array_map(function($m) use ($keyName) { |
|
756 | 756 | return $m->$keyName; |
757 | 757 | }, $entities); |
758 | 758 | } |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | */ |
903 | 903 | public function getForeignKey() |
904 | 904 | { |
905 | - return $this->table . '.' . $this->foreignKey; |
|
905 | + return $this->table.'.'.$this->foreignKey; |
|
906 | 906 | } |
907 | 907 | |
908 | 908 | /** |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | */ |
913 | 913 | public function getOtherKey() |
914 | 914 | { |
915 | - return $this->table . '.' . $this->otherKey; |
|
915 | + return $this->table.'.'.$this->otherKey; |
|
916 | 916 | } |
917 | 917 | |
918 | 918 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // of the related models matching on the foreign key that's on a parent. |
104 | 104 | $table = $this->relatedMap->getTable(); |
105 | 105 | |
106 | - $this->query->where($table . '.' . $this->otherKey, '=', $this->parent->getEntityAttribute($this->foreignKey)); |
|
106 | + $this->query->where($table.'.'.$this->otherKey, '=', $this->parent->getEntityAttribute($this->foreignKey)); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $query->select(new Expression('count(*)')); |
120 | 120 | |
121 | - $otherKey = $this->wrap($query->getTable() . '.' . $this->otherKey); |
|
121 | + $otherKey = $this->wrap($query->getTable().'.'.$this->otherKey); |
|
122 | 122 | |
123 | 123 | return $query->where($this->getQualifiedForeignKey(), '=', new Expression($otherKey)); |
124 | 124 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | // We'll grab the primary key name of the related models since it could be set to |
135 | 135 | // a non-standard name and not "id". We will then construct the constraint for |
136 | 136 | // our eagerly loading query so it returns the proper models from execution. |
137 | - $key = $this->relatedMap->getTable() . '.' . $this->otherKey; |
|
137 | + $key = $this->relatedMap->getTable().'.'.$this->otherKey; |
|
138 | 138 | |
139 | 139 | $this->query->whereIn($key, $this->getEagerModelKeys($entities)); |
140 | 140 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function getQualifiedForeignKey() |
299 | 299 | { |
300 | - return $this->parentMap->getTable() . '.' . $this->foreignKey; |
|
300 | + return $this->parentMap->getTable().'.'.$this->foreignKey; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -317,6 +317,6 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function getQualifiedOtherKeyName() |
319 | 319 | { |
320 | - return $this->relatedMap->getTable() . '.' . $this->otherKey; |
|
320 | + return $this->relatedMap->getTable().'.'.$this->otherKey; |
|
321 | 321 | } |
322 | 322 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $this->inverse = $inverse; |
50 | 50 | |
51 | - $this->morphType = $name . '_type'; |
|
51 | + $this->morphType = $name.'_type'; |
|
52 | 52 | |
53 | 53 | $this->morphClass = $inverse ? $mapper->getEntityMap()->getClass() : get_class($parent); |
54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | parent::setWhere(); |
66 | 66 | |
67 | - $this->query->where($this->table . '.' . $this->morphType, $this->morphClass); |
|
67 | + $this->query->where($this->table.'.'.$this->morphType, $this->morphClass); |
|
68 | 68 | |
69 | 69 | return $this; |
70 | 70 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | $query = parent::getRelationCountQuery($query, $parent); |
82 | 82 | |
83 | - return $query->where($this->table . '.' . $this->morphType, $this->morphClass); |
|
83 | + return $query->where($this->table.'.'.$this->morphType, $this->morphClass); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | parent::addEagerConstraints($entities); |
95 | 95 | |
96 | - $this->query->where($this->table . '.' . $this->morphType, $this->morphClass); |
|
96 | + $this->query->where($this->table.'.'.$this->morphType, $this->morphClass); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -312,7 +312,7 @@ |
||
312 | 312 | */ |
313 | 313 | public function getQualifiedParentKeyName() |
314 | 314 | { |
315 | - return $this->parentMap->getTable() . '.' . $this->localKey; |
|
315 | + return $this->parentMap->getTable().'.'.$this->localKey; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $farParentKeyName = $this->farParentMap->getKeyName(); |
94 | 94 | |
95 | 95 | $this->query->where( |
96 | - $parentTable . '.' . $this->firstKey, |
|
96 | + $parentTable.'.'.$this->firstKey, |
|
97 | 97 | '=', |
98 | 98 | $this->farParent->getEntityAttribute($farParentKeyName) |
99 | 99 | ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $query->select(new Expression('count(*)')); |
117 | 117 | |
118 | - $key = $this->wrap($parentTable . '.' . $this->firstKey); |
|
118 | + $key = $this->wrap($parentTable.'.'.$this->firstKey); |
|
119 | 119 | |
120 | 120 | return $query->where($this->getHasCompareKey(), '=', new Expression($key)); |
121 | 121 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $query = $query ?: $this->query; |
132 | 132 | |
133 | - $foreignKey = $this->relatedMap->getTable() . '.' . $this->secondKey; |
|
133 | + $foreignKey = $this->relatedMap->getTable().'.'.$this->secondKey; |
|
134 | 134 | |
135 | 135 | $query->join($this->parentMap->getTable(), $this->getQualifiedParentKeyName(), '=', $foreignKey); |
136 | 136 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | $table = $this->parentMap->getTable(); |
147 | 147 | |
148 | - $this->query->whereIn($table . '.' . $this->firstKey, $this->getKeys($entities)); |
|
148 | + $this->query->whereIn($table.'.'.$this->firstKey, $this->getKeys($entities)); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | protected function getSelectColumns(array $columns = ['*']) |
270 | 270 | { |
271 | 271 | if ($columns == ['*']) { |
272 | - $columns = [$this->relatedMap->getTable() . '.*']; |
|
272 | + $columns = [$this->relatedMap->getTable().'.*']; |
|
273 | 273 | } |
274 | 274 | |
275 | - return array_merge($columns, [$this->parentMap->getTable() . '.' . $this->firstKey]); |
|
275 | + return array_merge($columns, [$this->parentMap->getTable().'.'.$this->firstKey]); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | $host = $this; |
259 | 259 | |
260 | - return array_unique(array_values(array_map(function ($value) use ($key, $host) { |
|
260 | + return array_unique(array_values(array_map(function($value) use ($key, $host) { |
|
261 | 261 | if (!$value instanceof InternallyMappable) { |
262 | 262 | $value = $host->factory->make($value); |
263 | 263 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | $keyName = Mapper::getMapper($class)->getEntityMap()->getKeyName(); |
418 | 418 | |
419 | - return $class . '.' . $entity->getEntityAttribute($keyName); |
|
419 | + return $class.'.'.$entity->getEntityAttribute($keyName); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | /** |