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