Skip to content

Commit

Permalink
TASK: Tweak README and require neos/eventstore 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed Jan 19, 2024
1 parent a65fdbc commit 2a85653
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ Install via [composer](https://getcomposer.org):
composer require neos/eventstore-doctrineadapter
```

### Create an instance

To create a `DoctrineEventStore`, an instance of `\Doctrine\DBAL\Connection` is required.
This can be obtained from a given DSN for example:

```php
use Doctrine\DBAL\DriverManager;

$connection = DriverManager::getConnection(['url' => $dsn]);
```

See [Doctrine documentation](https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#getting-a-connection) for more details.

With that, an Event Store instance can be created:

```php
use Neos\EventStore\DoctrineAdapter\DoctrineEventStore;

$eventTableName = 'some_namespace_events';
$eventStore = new DoctrineEventStore($connection, $eventTableName);
```

See [README](https://github.com/neos/eventstore/blob/main/README.md#usage) of the `neos/eventstore` package for details on how to write and read events.

## Contribution

Contributions in the form of [issues](https://github.com/neos/eventstore-doctrineadapter/issues), [pull requests](https://github.com/neos/eventstore-doctrineadapter/pulls) or [discussions](https://github.com/neos/eventstore-doctrineadapter/discussions) are highly appreciated
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^8.1",
"neos/eventstore": "@dev",
"neos/eventstore": "^1",
"doctrine/dbal": "^2",
"webmozart/assert": "^1.10",
"psr/clock": "^1"
Expand Down

0 comments on commit 2a85653

Please sign in to comment.