Skip to content

Commit 3694b18

Browse files
author
codeliner
committed
Support Document Store v0.7
1 parent 19aba63 commit 3694b18

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/InnerDocumentStore.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace EventEngine\Persistence;
1313

1414
use EventEngine\DocumentStore\DocumentStore;
15+
use EventEngine\DocumentStore\Exception\RuntimeException;
16+
use EventEngine\DocumentStore\Exception\UnknownCollection;
1517
use EventEngine\DocumentStore\Filter\Filter;
1618
use EventEngine\DocumentStore\Index;
1719
use EventEngine\DocumentStore\OrderBy\OrderBy;
@@ -140,6 +142,30 @@ public function upsertDoc(string $collectionName, string $docId, array $docOrSub
140142
$this->documentStore->upsertDoc($collectionName, $docId, $docOrSubset);
141143
}
142144

145+
/**
146+
* @param string $collectionName
147+
* @param string $docId
148+
* @param array $doc
149+
* @throws UnknownCollection
150+
* @throws RuntimeException if updating did not succeed
151+
*/
152+
public function replaceDoc(string $collectionName, string $docId, array $doc): void
153+
{
154+
$this->documentStore->replaceDoc($collectionName, $docId, $doc);
155+
}
156+
157+
/**
158+
* @param string $collectionName
159+
* @param Filter $filter
160+
* @param array $set
161+
* @throws UnknownCollection
162+
* @throws RuntimeException in case of connection error or other issues
163+
*/
164+
public function replaceMany(string $collectionName, Filter $filter, array $set): void
165+
{
166+
$this->documentStore->replaceMany($collectionName, $filter, $set);
167+
}
168+
143169
/**
144170
* @param string $collectionName
145171
* @param string $docId

0 commit comments

Comments
 (0)