Skip to content

Commit befdef1

Browse files
committed
revised projection repo
1 parent 9c0a334 commit befdef1

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎docs/projection/repositories.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Saves a projection document. The document will be available on any subsequent qu
2929

3030
---
3131

32-
### `delete(DomainProjectionDocument $document): void`
32+
### `delete(string $type, string $id): void`
3333

34-
Deletes a projection document. The document will be unavailable on any subsequent query.
34+
Deletes a projection document by type and ID. The document will be unavailable on any subsequent query.
3535

3636
## Implementations
3737

‎src/Domain/Infra/Elasticsearch/DomainProjectionRepository.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ public function save(DomainProjectionDocument $document): void
8383
$this->client->index($params);
8484
}
8585

86-
public function delete(DomainProjectionDocument $document): void
86+
public function delete(string $type, string $id): void
8787
{
8888
$this->client->delete([
8989
'index' => $this->index,
90-
'type' => $document->getType(),
91-
'id' => $document->getId(),
90+
'type' => $type,
91+
'id' => $id,
9292
]);
9393
}
9494
}

‎src/Domain/Projection/DomainProjectionRepositoryInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ public function clear(string $type): void;
2020

2121
public function save(DomainProjectionDocument $document): void;
2222

23-
public function delete(DomainProjectionDocument $document): void;
23+
public function delete(string $type, string $id): void;
2424
}

0 commit comments

Comments
 (0)