2017 © Pedro Peláez
 

library domain-event

Library to manage domain events in a php DDD application

image

gbprod/domain-event

Library to manage domain events in a php DDD application

  • Monday, September 12, 2016
  • by gbprod
  • Repository
  • 1 Watchers
  • 3 Stars
  • 226 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Domain event

stability-deprecated, (*1)

Build Status Scrutinizer Code Quality Code Coverage, (*2)

Latest Stable Version Total Downloads Latest Unstable Version License, (*3)

Library to manage domain events in a php DDD application., (*4)

Usage

Create a domain event

<?php

namespace GBProd\Acme\Event;

use GBProd\DomainEvent\DomainEvent;

class SomethingHappenedEvent implements DomainEvent
{
    private $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

    public function getAggregateId()
    {
        return $id;
    }
}

Raise your event

<?php

namespace GBProd\Acme\Entity;

use GBProd\DomainEvent\EventProvider;
use GBProd\DomainEvent\EventProviderTrait;

final class MyEntity implements EventProvider
{
    use EventProviderTrait;

    public function doSomething()
    {
        $this->raise(
            new SomethingHappenedEvent($this->id)
        );
    }
}

Dispatch events

<?php

namespace GBProd\Acme\Repository;

use GBProd\DomainEvent\EventProvider;

class MyEntityRepository
{
    public function save(MyEntity $entity)
    {
        $this->persist($entity);

        $this->dispatcher->dispatch($entity);
    }
}

Requirements

  • PHP 5.5+

Installation

Using composer

composer require gbprod/domain-event

The Versions

12/09 2016

dev-master

9999999-dev

Library to manage domain events in a php DDD application

  Sources   Download

MIT

The Development Requires

by Avatar gbprod

11/03 2016

v0.1.0

0.1.0.0

Library to manage domain events in a php DDD application

  Sources   Download

MIT

The Development Requires

by Avatar gbprod

11/03 2016

v0.1-alpha.1

0.1.0.0-alpha1

Library to manage domain events in a php DDD application

  Sources   Download

MIT

The Development Requires

by Avatar gbprod

10/03 2016

v0.1-alpha

0.1.0.0-alpha

Library to manage domain events in a php DDD application

  Sources   Download

MIT

The Development Requires

by Avatar gbprod

10/03 2016

v0.0.2-alpha

0.0.2.0-alpha

Library to manage domain events in a php DDD application

  Sources   Download

MIT

The Development Requires

by Avatar gbprod

10/03 2016

v0.0.1-alpha

0.0.1.0-alpha

Library to manage domain events in a php DDD application

  Sources   Download

MIT

The Development Requires

by Avatar gbprod