| Conditions | 2 |
| Paths | 2 |
| Total Lines | 27 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function handle(Dispatcher $events) |
||
| 32 | { |
||
| 33 | $class = $this->argument('model'); |
||
| 34 | |||
| 35 | $model = new $class; |
||
| 36 | $tnt = new TNTSearch; |
||
| 37 | $driver = config('database.default'); |
||
| 38 | $config = config('scout.tntsearch') + config("database.connections.$driver"); |
||
| 39 | |||
| 40 | $tnt->loadConfig($config); |
||
| 41 | $tnt->setDatabaseHandle(app('db')->connection()->getPdo()); |
||
|
|
|||
| 42 | |||
| 43 | $indexer = $tnt->createIndex($model->searchableAs() . ".index"); |
||
| 44 | $indexer->setPrimaryKey($model->getKeyName()); |
||
| 45 | $fields = implode(', ', array_keys($model->toSearchableArray())); |
||
| 46 | |||
| 47 | $query = "{$model->getKeyName()}, $fields"; |
||
| 48 | |||
| 49 | if ($fields == "") { |
||
| 50 | $query = "*"; |
||
| 51 | } |
||
| 52 | |||
| 53 | $indexer->query("SELECT $query FROM {$model->getTable()};"); |
||
| 54 | |||
| 55 | $indexer->run(); |
||
| 56 | $this->info('All [' . $class . '] records have been imported.'); |
||
| 57 | } |
||
| 58 | } |
||
| 59 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.