@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $index->indexBeginTransaction(); |
65 | - $models->each(function ($model) use ($index, $geoindex) { |
|
65 | + $models->each(function($model) use ($index, $geoindex) { |
|
66 | 66 | $array = $model->toSearchableArray(); |
67 | 67 | |
68 | 68 | if (empty($array)) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function delete($models) |
97 | 97 | { |
98 | 98 | $this->initIndex($models->first()); |
99 | - $models->each(function ($model) { |
|
99 | + $models->each(function($model) { |
|
100 | 100 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
101 | 101 | $index = $this->tnt->getIndex(); |
102 | 102 | $index->setPrimaryKey($model->getKeyName()); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | // sort models by tnt search result set |
243 | - return collect($results['ids'])->map(function ($hit) use ($models) { |
|
243 | + return collect($results['ids'])->map(function($hit) use ($models) { |
|
244 | 244 | if (isset($models[$hit])) { |
245 | 245 | return $models[$hit]; |
246 | 246 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | |
336 | 336 | $discardIds = $builder->model->newQuery() |
337 | 337 | ->select($qualifiedKeyName) |
338 | - ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '. $builder->model->getConnection()->getTablePrefix() .'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName) |
|
338 | + ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '.$builder->model->getConnection()->getTablePrefix().'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName) |
|
339 | 339 | ->addBinding($sub->getQuery()->getBindings(), 'join') |
340 | 340 | ->whereIn($qualifiedKeyName, $searchResults) |
341 | 341 | ->whereNull($subQualifiedKeyName) |
@@ -406,10 +406,10 @@ discard block |
||
406 | 406 | private function applyWheres($builder) |
407 | 407 | { |
408 | 408 | // iterate over given where clauses |
409 | - return collect($this->builder->wheres)->map(function ($value, $key) { |
|
409 | + return collect($this->builder->wheres)->map(function($value, $key) { |
|
410 | 410 | // for reduce function combine key and value into array |
411 | 411 | return [$key, $value]; |
412 | - })->reduce(function ($builder, $where) { |
|
412 | + })->reduce(function($builder, $where) { |
|
413 | 413 | // separate key, value again |
414 | 414 | list($key, $value) = $where; |
415 | 415 | return $builder->where($key, $value); |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | private function applyOrders($builder) |
426 | 426 | { |
427 | 427 | //iterate over given orderBy clauses - should be only one |
428 | - return collect($this->builder->orders)->map(function ($value, $key) { |
|
428 | + return collect($this->builder->orders)->map(function($value, $key) { |
|
429 | 429 | // for reduce function combine key and value into array |
430 | 430 | return [$value["column"], $value["direction"]]; |
431 | - })->reduce(function ($builder, $orderBy) { |
|
431 | + })->reduce(function($builder, $orderBy) { |
|
432 | 432 | // separate key, value again |
433 | 433 | list($column, $direction) = $orderBy; |
434 | 434 | return $builder->orderBy($column, $direction); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | unlink($pathToIndex); |
450 | 450 | } |
451 | 451 | |
452 | - if ($this->geotnt){ |
|
452 | + if ($this->geotnt) { |
|
453 | 453 | $pathToGeoIndex = $this->geotnt->config['storage']."/{$indexName}.index"; |
454 | 454 | if (file_exists($pathToGeoIndex)) { |
455 | 455 | unlink($pathToGeoIndex); |