Download the PHP package dualmedia/symfony-doctrine-event-converter-bundle without Composer

On this page you can find all versions of the php package dualmedia/symfony-doctrine-event-converter-bundle. 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 symfony-doctrine-event-converter-bundle

Doctrine Event Dispatcher Bundle

Code Coverage Packagist Downloads

This bundle is meant to convert between doctrine and symfony events seamlessly, as well as allow for creation of sub-events with their own requirements and checks

It allows you to streamline doctrine actions using symfony directly, without need of implementing doctrine's listeners and event logic.

All of the hard work is already done, just declare your entities, implement EntityInterface on them, and create an abstract event class.

Installation

Simply composer require dualmedia/symfony-doctrine-event-converter-bundle

Then add the bundle to your config/bundles.php file like so

Usage

Entity

Make a Doctrine-managed entity, that also implements the DualMedia\DoctrineEventDistributorBundle\Interfaces\EntityInterface

Event

Create an event class (not final), and then at some point extend DualMedia\DoctrineEventDistributorBundle\Event\AbstractEntityEvent, mark this class with your appropriate event annotation, either one of the base ones or SubEvent

The bundle will then automatically generate proxy classes for appropriate events.

Each proxy class starts with the proxy namespace visible here under the PROXY_NS constant value.

The following class name will always contain the full namespace of the parent event. This namespace is loaded via the autoloader in the bundle and should not be interacted with in ways other than subscribers and general use.

SubEvent

Let's assume the following scenario: You wish to have an event fired when the status of the Item changes from pending to complete, in this case you'd add the following attribute on your ItemEvent (above).

SubEvents can take form of checks which apply to the previous and current state of variable, or only one (from OR to).

Important

Because of how Doctrine passes changes unfortunately changes to collections are not known at this time.

From and To

The following will generate an ItemPendingToCompleteEvent class (under the default proxy namespace).

Assuming of course the existence of an enum or other value which can be passed to the Change model.

More than one change can be required at a time, or any change, depending on SubEvent::$allMode.

From

The following will generate an ItemFromPendingEvent.

To

The following will generate an ItemCompleteEvent.

PHPStan and Psalm issue ignoring

Ready-to-use templates are available below to make your lives a bit easier.

Plugins may be provided at a later time, but it's not certain.

PHPStan

Note: in future a phpstan.neon file will be provided to ignore these issues, for the time being simply add the following lines into your file.

I also suggest disabling reportUnmatchedIgnoredErrors in your config, but it's not strictly necessary.

Psalm

This configuration needs to be copied over as psalm does not allow including files.


All versions of symfony-doctrine-event-converter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/doctrine-bundle Version ^1.12|^2.0
doctrine/orm Version ^2.14|^3
symfony/framework-bundle Version ^5.4|^6.2|^7
symfony/event-dispatcher Version ^5.4|^6.2|^7
symfony/property-access Version ^5.4|^6.2|^7
symfony/http-kernel Version ^5.4|^6.2|^7
doctrine/common Version ^2|^3
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 dualmedia/symfony-doctrine-event-converter-bundle contains the following files

Loading the files please wait ....