Download the PHP package dsantang/domain-events-doctrine without Composer

On this page you can find all versions of the php package dsantang/domain-events-doctrine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package domain-events-doctrine

Domain Events Doctrine

CircleCI Scrutinizer Code Quality Code Coverage Build Status SymfonyInsight

This package is meant to be used in conjunction with dsantang/domain-events,
which provides the basic building blocks needed in order to create your application's domain events.
This package provides an integration with Doctrine ORM,
in order to automatically dispatch the recorded domain events once the ORM's flush() operation is successful.
Events are dispatched via a Symfony's EventDispatcherInterface.

Installation

The suggested installation method is via composer:

Configuration

In order to automagically dispatch your domain events, you first need to add two event listeners to your Doctrine's EventManager. These Doctrine's listeners will be listening to Doctrine's lifecycle events, and, only once the transaction has successfully been made, they'll dispatch your domain events.

That's it! You're all set! Now you can add as many Symfony's listeners as you need to your $dispatcher,
and you'll be able to react to the domain events raised by your application.

Outbox pattern

This library also provides support for the Outbox pattern implementation.
The idea behind the implementation is to be able to add entities to an "ongoing" transaction by hooking into Doctrine's onFlush event, creating "outbox" entries based on the application's domain events, and safely store them using the same DB transaction.

In order to enrich your Domain Event and be able to set all the data required by the Outbox entity, you need to create a Converter class (by implementing Dsantang\DomainEventsDoctrine\Outbox\Converter interface) An example of an outbox event is as follows:

In order to persist your Outbox entries, you must create a Doctrine Entity class inside your application that extends Dsantang\DomainEventsDoctrine\Outbox\OutboxMappedSuperclass.
Please note that this approach uses Doctrine's Inheritance Mapping:

Here is an example of an Outbox Entity class:

And an example of the required configuration as is follows:
Warning: this solution assumes that you're using Dsantang\DomainEvents\DomainEvent in order to raise your domain events.


All versions of domain-events-doctrine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/dbal Version ^3.5
doctrine/orm Version ^2.8
dsantang/domain-events Version ^0.5
ramsey/uuid Version ^4.1
symfony/event-dispatcher Version ^5.2
symfony/event-dispatcher-contracts Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dsantang/domain-events-doctrine contains the following files

Loading the files please wait ....