@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | if ($geoindex) { |
| 66 | 66 | $geoindex->indexBeginTransaction(); |
| 67 | 67 | } |
| 68 | - $models->each(function ($model) use ($index, $geoindex) { |
|
| 68 | + $models->each(function($model) use ($index, $geoindex) { |
|
| 69 | 69 | $array = $model->toSearchableArray(); |
| 70 | 70 | |
| 71 | 71 | if (empty($array)) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public function delete($models) |
| 103 | 103 | { |
| 104 | 104 | $this->initIndex($models->first()); |
| 105 | - $models->each(function ($model) { |
|
| 105 | + $models->each(function($model) { |
|
| 106 | 106 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
| 107 | 107 | $index = $this->tnt->getIndex(); |
| 108 | 108 | $index->setPrimaryKey($model->getKeyName()); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // sort models by tnt search result set |
| 249 | - return collect($results['ids'])->map(function ($hit) use ($models) { |
|
| 249 | + return collect($results['ids'])->map(function($hit) use ($models) { |
|
| 250 | 250 | if (isset($models[$hit])) { |
| 251 | 251 | return $models[$hit]; |
| 252 | 252 | } |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | $discardIds = $builder->model->newQuery() |
| 343 | 343 | ->select($qualifiedKeyName) |
| 344 | - ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '. $builder->model->getConnection()->getTablePrefix() .'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName) |
|
| 344 | + ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '.$builder->model->getConnection()->getTablePrefix().'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName) |
|
| 345 | 345 | ->addBinding($sub->getQuery()->getBindings(), 'join') |
| 346 | 346 | ->whereIn($qualifiedKeyName, $searchResults) |
| 347 | 347 | ->whereNull($subQualifiedKeyName) |
@@ -412,10 +412,10 @@ discard block |
||
| 412 | 412 | private function applyWheres($builder) |
| 413 | 413 | { |
| 414 | 414 | // iterate over given where clauses |
| 415 | - return collect($this->builder->wheres)->map(function ($value, $key) { |
|
| 415 | + return collect($this->builder->wheres)->map(function($value, $key) { |
|
| 416 | 416 | // for reduce function combine key and value into array |
| 417 | 417 | return [$key, $value]; |
| 418 | - })->reduce(function ($builder, $where) { |
|
| 418 | + })->reduce(function($builder, $where) { |
|
| 419 | 419 | // separate key, value again |
| 420 | 420 | list($key, $value) = $where; |
| 421 | 421 | return $builder->where($key, $value); |
@@ -431,10 +431,10 @@ discard block |
||
| 431 | 431 | private function applyOrders($builder) |
| 432 | 432 | { |
| 433 | 433 | //iterate over given orderBy clauses - should be only one |
| 434 | - return collect($this->builder->orders)->map(function ($value, $key) { |
|
| 434 | + return collect($this->builder->orders)->map(function($value, $key) { |
|
| 435 | 435 | // for reduce function combine key and value into array |
| 436 | 436 | return [$value["column"], $value["direction"]]; |
| 437 | - })->reduce(function ($builder, $orderBy) { |
|
| 437 | + })->reduce(function($builder, $orderBy) { |
|
| 438 | 438 | // separate key, value again |
| 439 | 439 | list($column, $direction) = $orderBy; |
| 440 | 440 | return $builder->orderBy($column, $direction); |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | unlink($pathToIndex); |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - if ($this->geotnt){ |
|
| 458 | + if ($this->geotnt) { |
|
| 459 | 459 | $pathToGeoIndex = $this->geotnt->config['storage']."/{$indexName}.index"; |
| 460 | 460 | if (file_exists($pathToGeoIndex)) { |
| 461 | 461 | unlink($pathToGeoIndex); |