Skip to content

Commit

Permalink
inject client in persister
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Lemay committed Aug 30, 2024
1 parent b726104 commit 3187d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Om/Mapping/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
public ?RepositoryInterface $repository = null,
public ?RedisClientInterface $redisClient = null,
) {
$this->persister = $persister ?? ($format === RedisFormat::JSON->value ? new JsonPersister() : new HashPersister());
$this->persister = $persister ?? ($format === RedisFormat::JSON->value ? new JsonPersister(redis: $this->redisClient) : new HashPersister(redis: $this->redisClient));
$this->converter = $converter ?? ($format === RedisFormat::JSON->value ? new JsonObjectConverter() : new HashObjectConverter());
$this->repository = $repository ?? ($format === RedisFormat::JSON->value ? new JsonRepository() : new HashRepository());
$this->redisClient = $redisClient ?? (new RedisClient());
Expand Down

0 comments on commit 3187d98

Please sign in to comment.