| @@ 51-62 (lines=12) @@ | ||
| 48 | /** |
|
| 49 | * Import the given models into the search index. |
|
| 50 | */ |
|
| 51 | public function actionImport() |
|
| 52 | { |
|
| 53 | $models = explode(',', $this->models); |
|
| 54 | $models = array_filter($models); |
|
| 55 | ||
| 56 | foreach ($models as $model) { |
|
| 57 | $model = trim($model); |
|
| 58 | $model::makeAllSearchable(); |
|
| 59 | ||
| 60 | $this->stdout('All [' . $model . '] records have been imported.'); |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * Delete the model class records from the index. |
|
| @@ 67-78 (lines=12) @@ | ||
| 64 | /** |
|
| 65 | * Delete the model class records from the index. |
|
| 66 | */ |
|
| 67 | public function actionDelete() |
|
| 68 | { |
|
| 69 | $models = explode(',', $this->models); |
|
| 70 | $models = array_filter($models); |
|
| 71 | ||
| 72 | foreach ($models as $model) { |
|
| 73 | $model = trim($model); |
|
| 74 | $model::deleteAllFromSearch(); |
|
| 75 | ||
| 76 | $this->stdout('All [' . $model . '] records have been deleted.'); |
|
| 77 | } |
|
| 78 | } |
|
| 79 | ||
| 80 | ||
| 81 | } |
|