@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $index->setPrimaryKey($models->first()->getKeyName()); |
| 48 | 48 | |
| 49 | 49 | $index->indexBeginTransaction(); |
| 50 | - $models->each(function ($model) use ($index) { |
|
| 50 | + $models->each(function($model) use ($index) { |
|
| 51 | 51 | $array = $model->toSearchableArray(); |
| 52 | 52 | |
| 53 | 53 | if (empty($array)) { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | public function delete($models) |
| 74 | 74 | { |
| 75 | 75 | $this->initIndex($models->first()); |
| 76 | - $models->each(function ($model) { |
|
| 76 | + $models->each(function($model) { |
|
| 77 | 77 | $this->tnt->selectIndex("{$model->searchableAs()}.index"); |
| 78 | 78 | $index = $this->tnt->getIndex(); |
| 79 | 79 | $index->setPrimaryKey($model->getKeyName()); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // sort models by tnt search result set |
| 202 | - return $this->collect($results['ids'])->map(function ($hit) use ($models) { |
|
| 202 | + return $this->collect($results['ids'])->map(function($hit) use ($models) { |
|
| 203 | 203 | if (isset($models[$hit])) { |
| 204 | 204 | return $models[$hit]; |
| 205 | 205 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | $discardIds = $builder->model->newQuery() |
| 290 | 290 | ->select($qualifiedKeyName) |
| 291 | - ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '. $builder->model->getConnection()->getTablePrefix() .'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName) |
|
| 291 | + ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '.$builder->model->getConnection()->getTablePrefix().'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName) |
|
| 292 | 292 | ->addBinding($sub->getQuery()->getBindings(), 'join') |
| 293 | 293 | ->whereIn($qualifiedKeyName, $searchResults) |
| 294 | 294 | ->whereNull($subQualifiedKeyName) |
@@ -359,10 +359,10 @@ discard block |
||
| 359 | 359 | private function applyWheres($builder) |
| 360 | 360 | { |
| 361 | 361 | // iterate over given where clauses |
| 362 | - return collect($this->builder->wheres)->map(function ($value, $key) { |
|
| 362 | + return collect($this->builder->wheres)->map(function($value, $key) { |
|
| 363 | 363 | // for reduce function combine key and value into array |
| 364 | 364 | return [$key, $value]; |
| 365 | - })->reduce(function ($builder, $where) { |
|
| 365 | + })->reduce(function($builder, $where) { |
|
| 366 | 366 | // separate key, value again |
| 367 | 367 | list($key, $value) = $where; |
| 368 | 368 | return $builder->where($key, $value); |
@@ -378,10 +378,10 @@ discard block |
||
| 378 | 378 | private function applyOrders($builder) |
| 379 | 379 | { |
| 380 | 380 | //iterate over given orderBy clauses - should be only one |
| 381 | - return collect($this->builder->orders)->map(function ($value, $key) { |
|
| 381 | + return collect($this->builder->orders)->map(function($value, $key) { |
|
| 382 | 382 | // for reduce function combine key and value into array |
| 383 | 383 | return [$value["column"], $value["direction"]]; |
| 384 | - })->reduce(function ($builder, $orderBy) { |
|
| 384 | + })->reduce(function($builder, $orderBy) { |
|
| 385 | 385 | // separate key, value again |
| 386 | 386 | list($column, $direction) = $orderBy; |
| 387 | 387 | return $builder->orderBy($column, $direction); |