From 22aa901013a2fedd83ddb0893304cc96400937f1 Mon Sep 17 00:00:00 2001 From: David Badura Date: Thu, 19 Nov 2020 23:16:12 +0100 Subject: [PATCH] improve naming --- src/Repository/Repository.php | 3 +-- src/Store/MysqlSingleTableStore.php | 2 +- src/Store/Store.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Repository/Repository.php b/src/Repository/Repository.php index 7395bf51..da2dc233 100644 --- a/src/Repository/Repository.php +++ b/src/Repository/Repository.php @@ -31,7 +31,6 @@ final class Repository */ private array $instances = []; - public function __construct( Store $store, EventStream $eventStream, @@ -80,7 +79,7 @@ public function save(AggregateRoot $aggregate): void return; } - $this->store->save($this->aggregateClass, $aggregate->aggregateRootId(), $eventStream); + $this->store->saveBatch($this->aggregateClass, $aggregate->aggregateRootId(), $eventStream); foreach ($eventStream as $event) { $this->eventStream->dispatch($event); diff --git a/src/Store/MysqlSingleTableStore.php b/src/Store/MysqlSingleTableStore.php index 23616c5b..a04d2927 100644 --- a/src/Store/MysqlSingleTableStore.php +++ b/src/Store/MysqlSingleTableStore.php @@ -90,7 +90,7 @@ public function count(): int * @param class-string $aggregate * @param AggregateChanged[] $events */ - public function save(string $aggregate, string $id, array $events): void + public function saveBatch(string $aggregate, string $id, array $events): void { $this->connection->transactional( static function (Connection $connection) use ($aggregate, $id, $events): void { diff --git a/src/Store/Store.php b/src/Store/Store.php index c8df27bc..df69a2ab 100644 --- a/src/Store/Store.php +++ b/src/Store/Store.php @@ -32,7 +32,7 @@ public function count(): int; * @param class-string $aggregate * @param AggregateChanged[] $events */ - public function save(string $aggregate, string $id, array $events): void; + public function saveBatch(string $aggregate, string $id, array $events): void; public function prepare(): void;