PHPackages                             knplabs/rad-domain-event - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. knplabs/rad-domain-event

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

knplabs/rad-domain-event
========================

Provide RAD Domain Event component

v2.1.1(7y ago)552.0k↓16.7%4[3 PRs](https://github.com/KnpLabs/rad-domain-event/pulls)MITPHPPHP ~7.0

Since Jun 24Pushed 3y ago23 watchersCompare

[ Source](https://github.com/KnpLabs/rad-domain-event)[ Packagist](https://packagist.org/packages/knplabs/rad-domain-event)[ RSS](/packages/knplabs-rad-domain-event/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (9)Used By (0)

DEPRECATED
==========

[](#deprecated)

Unfortunately we decided to not maintain this project anymore ([see why](https://knplabs.com/en/blog/news-for-our-foss-projects-maintenance)). If you want to mark another package as a replacement for this one please send an email to .

Knp Rad Domain Event
====================

[](#knp-rad-domain-event)

[![Build Status](https://camo.githubusercontent.com/304f1a503ac55cae50949b895ba56ee8d568222d69ae918a763a42de3872effb/68747470733a2f2f7472617669732d63692e6f72672f4b6e704c6162732f7261642d646f6d61696e2d6576656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/KnpLabs/rad-domain-event)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8f9ae3b6be45997798220b4abb3305b213b07b500e93ff57ed8b221803025b76/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6e704c6162732f7261642d646f6d61696e2d6576656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KnpLabs/rad-domain-event/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/86e1e7f6a8db35d5ff2cd4c1a03fb451eb906037ddce8e9b12ae31284cc94c86/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d646f6d61696e2d6576656e742f762f737461626c65)](https://packagist.org/packages/knplabs/rad-domain-event) [![Total Downloads](https://camo.githubusercontent.com/47eb94240244ef86293eccadc95ee679010e6398b76d0f4c760af5ed4382b5d9/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d646f6d61696e2d6576656e742f646f776e6c6f616473)](https://packagist.org/packages/knplabs/rad-domain-event) [![Latest Unstable Version](https://camo.githubusercontent.com/01decb2a66a6c7615f977c3fa1b991819604f86c2123b446a3594d9adac3e61f/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d646f6d61696e2d6576656e742f762f756e737461626c65)](https://packagist.org/packages/knplabs/rad-domain-event) [![License](https://camo.githubusercontent.com/1ce5d6b2ec5632fddb5dc3af72308e4947a13b9c4bc7c727dad35dd4fd993e0e/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d646f6d61696e2d6576656e742f6c6963656e7365)](https://packagist.org/packages/knplabs/rad-domain-event)

A lightweight domain event pattern implementation for Doctrine2.

Official maintainers:
=====================

[](#official-maintainers)

- [@Einenlum](https://github.com/Einenlum)

Installation
------------

[](#installation)

With composer :

```
$ composer require knplabs/rad-domain-event
```

If you are using Symfony you can update your `app/AppKernel.php` file:

```
public function registerBundles()
{
    $bundles = array(
        // bundles here ...
        new Knp\Rad\DomainEvent\Bundle\DomainEventBundle();
    );
}
```

Usage
-----

[](#usage)

### Setup your entity

[](#setup-your-entity)

First, make sure your entity implements the [Provider](./src/Knp/Rad/DomainEvent/Provider.php) interface and uses the [ProviderTrait](./src/Knp/Rad/DomainEvent/ProviderTrait.php).

```
use Knp\Rad\DomainEvent;

class MyEntity implements DomainEvent\Provider
{
    use DomainEvent\ProviderTrait;
}
```

### Raise event

[](#raise-event)

Trigger any event from your entity, through the `raise` method. It will be turned into a [Knp\\Rad\\DomainEvent\\Event](./src/Knp/Rad/DomainEvent/Event.php) object and dispatched once your entity has been flushed.

```
use Knp\Rad\DomainEvent;

class MyEntity implements DomainEvent\Provider
{
    // ...
    public function myFunction($arg) {
        // your function behavior
        $this->raise('myEventName', ['anyKey' => $anyValue]);
    }
}
```

### Listen to this event

[](#listen-to-this-event)

```
use Knp\Rad\DomainEvent\Event;

class MyListener
{
    public function onMyEventName(Event $event) {
        // your function behavior
    }
}
```

Then, of course, register your listener.

```
app.event_listener.my_event_listener:
    class: App\EventListener\MyEventListener
    tags:
        - { name: kernel.event_listener, event: myEventName, method: 'onMyEventName' }
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~192 days

Recently: every ~249 days

Total

7

Last Release

2825d ago

Major Versions

0.1.0 → 1.0.02015-11-30

1.0.x-dev → v2.0.02016-03-04

PHP version history (2 changes)2.0.1PHP &gt;=5.4

v2.1.0PHP ~7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202732?v=4)[KNP Labs](/maintainers/KnpLabs)[@KnpLabs](https://github.com/KnpLabs)

---

Top Contributors

[![Shivoham](https://avatars.githubusercontent.com/u/1434539?v=4)](https://github.com/Shivoham "Shivoham (3 commits)")[![polc](https://avatars.githubusercontent.com/u/3513348?v=4)](https://github.com/polc "polc (2 commits)")[![alexpozzi](https://avatars.githubusercontent.com/u/8307861?v=4)](https://github.com/alexpozzi "alexpozzi (1 commits)")[![gquemener](https://avatars.githubusercontent.com/u/668604?v=4)](https://github.com/gquemener "gquemener (1 commits)")[![kubk](https://avatars.githubusercontent.com/u/22447849?v=4)](https://github.com/kubk "kubk (1 commits)")[![PedroTroller](https://avatars.githubusercontent.com/u/1766827?v=4)](https://github.com/PedroTroller "PedroTroller (1 commits)")

### Embed Badge

![Health badge](/badges/knplabs-rad-domain-event/health.svg)

```
[![Health](https://phpackages.com/badges/knplabs-rad-domain-event/health.svg)](https://phpackages.com/packages/knplabs-rad-domain-event)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19280.3k3](/packages/symfony-ux-cropperjs)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[pentiminax/ux-datatables

DataTables.net integration for Symfony

605.6k](/packages/pentiminax-ux-datatables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
