| @@ 86-96 (lines=11) @@ | ||
| 83 | return $models; |
|
| 84 | } |
|
| 85 | ||
| 86 | public function insert(Storable $model) |
|
| 87 | { |
|
| 88 | $collection = new ElasticsearchCollectionParser($model->getCollection()); |
|
| 89 | $params = [ |
|
| 90 | 'index' => $collection->getIndex(), |
|
| 91 | 'type' => $collection->getType(), |
|
| 92 | 'id' => $model->getPrimaryKey(), |
|
| 93 | 'body' => $model->toArray() |
|
| 94 | ]; |
|
| 95 | $this->client->index($params); |
|
| 96 | } |
|
| 97 | ||
| 98 | public function update(Storable $model) |
|
| 99 | { |
|
| @@ 98-108 (lines=11) @@ | ||
| 95 | $this->client->index($params); |
|
| 96 | } |
|
| 97 | ||
| 98 | public function update(Storable $model) |
|
| 99 | { |
|
| 100 | $collection = new ElasticsearchCollectionParser($model->getCollection()); |
|
| 101 | $params = [ |
|
| 102 | 'index' => $collection->getIndex(), |
|
| 103 | 'type' => $collection->getType(), |
|
| 104 | 'id' => $model->getPrimaryKey(), |
|
| 105 | 'body' => $model->toArray() |
|
| 106 | ]; |
|
| 107 | $this->client->index($params); |
|
| 108 | } |
|
| 109 | ||
| 110 | public function delete(Storable $model) |
|
| 111 | { |
|
| @@ 110-119 (lines=10) @@ | ||
| 107 | $this->client->index($params); |
|
| 108 | } |
|
| 109 | ||
| 110 | public function delete(Storable $model) |
|
| 111 | { |
|
| 112 | $collection = new ElasticsearchCollectionParser($model->getCollection()); |
|
| 113 | $params = [ |
|
| 114 | 'index' => $collection->getIndex(), |
|
| 115 | 'type' => $collection->getType(), |
|
| 116 | 'id' => $model->getPrimaryKey() |
|
| 117 | ]; |
|
| 118 | $this->client->delete($params); |
|
| 119 | } |
|
| 120 | } |
|