PHP code example of mauretto78 / simple-event-store-manager-bundle
1. Go to this page and download the library: Download mauretto78/simple-event-store-manager-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mauretto78 / simple-event-store-manager-bundle example snippets
// ..
$bundles[] = new SimpleEventStoreManager\Bundle\SimpleEventStoreManagerBundle();
// ..
$manager = $this->container->get('simple_event_store_manager');
$eventManager = $manager->getEventMananger();
// store events in an aggregate
$eventManager->storeEvents(
'name-of-your-aggregate',
[
...
]
);
// get event streams
$eventQuery = $eventStoreManager->getEventQuery();
$stream = $eventQuery->fromAggregate('Your aggregate');
foreach ($stream as $event){
// ..
}