2017 © Pedro Peláez
 

symfony-bundle simple-event-store-manager-bundle

PHP Bundle

image

mauretto78/simple-event-store-manager-bundle

PHP Bundle

  • Tuesday, September 19, 2017
  • by mauretto78
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Simple EventStore Manager Bundle

Codacy Badge license Packagist, (*1)

This is the official Symfony bundle for Simple EventStore Manager package., (*2)

Install Guide

Step 1: Include Simple EventStore Manager Bundle in your project with composer:

composer require mauretto78/simple-event-store-manager-bundle

Step 2: Setup your config.yml to configure your driver and connection parameters

Here is an example:, (*3)

# Simple EventStore Manager
simple_event_store_manager:
    driver: 'mongo'
    api_format: 'yaml'
    parameters:
        host: 'localhost'
        username: ~
        password: ~
        database: 'eventstore_demo'
        port: '27017'
    return_type: 'array'   
    elastic:
        host: 'localhost'
        port: '9200'
  • return_type is an optional parameter; you can choose between array or object to return aggregates
  • api_format is an optional parameter; you can choose between json (default), xml or yaml
  • elastic is an optional parameter; you can send your events to a Elastic server

Please refer to Simple EventStore Manager page for more details., (*4)

Step 3: Setup your AppKernel.php by adding the Simple EventStore Manager Bundle

// ..
$bundles[] = new SimpleEventStoreManager\Bundle\SimpleEventStoreManagerBundle();

Step 4: Setup yor routing.yml

Add these lines at the bottom of your routing.yml file:, (*5)

_simple_event_store_manager:
    resource: '@SimpleEventStoreManagerBundle/Resources/config/routing.yml'

Usage Guide

You can use EventsManager in your Controllers:, (*6)

// ..

$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){
    // ..
}

Or inject it into your services and classes:, (*7)

services:
     # ...

     AppBundle\Your\Service:
         arguments: ['@simple_event_store_manager']

Please refer to official documentation of Simple EventStore Manager for basic usage of this Library., (*8)

API support

An API endpoint is automatically exposed to /_events/{aggregate}/{page} route; it will automatically paged with 25 records per page., (*9)

When a page is complete, it will set automatically an infinite cache on it., (*10)

Support

If you found an issue or had an idea please refer to this section., (*11)

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details, (*12)

The Versions

07/07 2017

v1.0.2

1.0.2.0 https://github.com/mauretto78/simple-event-store-manager-bundle

PHP Bundle

  Sources   Download

MIT

The Requires

 

php events bundle symfony event-sourcing domain-driven-design

06/07 2017

v1.0.1

1.0.1.0 https://github.com/mauretto78/simple-event-store-manager-bundle

PHP Bundle

  Sources   Download

MIT

The Requires

 

php events bundle symfony event-sourcing domain-driven-design

05/07 2017

v1.0.0

1.0.0.0 https://github.com/mauretto78/simple-event-store-manager-bundle

PHP Bundle

  Sources   Download

MIT

The Requires

 

php events bundle symfony event-sourcing domain-driven-design