PHPackages                             fspringveldt/silverstripe-event-mediator - 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. fspringveldt/silverstripe-event-mediator

ActiveSilverstripe-module

fspringveldt/silverstripe-event-mediator
========================================

A Silverstripe event emitter based on the mediator pattern

161PHP

Since Jan 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/fspringveldt/silverstripe-event-mediator)[ Packagist](https://packagist.org/packages/fspringveldt/silverstripe-event-mediator)[ RSS](/packages/fspringveldt-silverstripe-event-mediator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SilverStripe Event Mediator
===========================

[](#silverstripe-event-mediator)

A SilverStripe event emitter based on the mediator pattern, which can be applied to run a bit of code before or after any class method (i.e. triggered) using Silverstripe's [Aspects](https://docs.silverstripe.org/en/3.4/developer_guides/extending/aspects/)

Requirements
------------

[](#requirements)

```
"silverstripe/framework": "3.*"
"composer"

```

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

[](#installation)

To install, run below from root of SilverStripe installation:

```
> composer require fspringveldt/silverstripe-event-mediator
```

http://**your-site-url**?flush=1 once composer is complete the flush the manifest.

\##Configuration 1 - Extension based (default) Installing the module adds the `eventMediator\EventExtension` to DataObject. Let's say after each call to `$A->foo()` you'd like to fire off a call to `$B->bar()`, the following added to your composer.yml sets up the events:

```
Injector:
  eventMediator\EventMediator':
    properties:
      events:
        foo:
          triggerBar:
            class: B
            method: bar
```

then in `$A->foo()` do the following:

```
class A{
    function foo(){
        //foo funciton body

        $this->emit(__FUNCTION__);
    }
}
```

\##Configuration 2 - Aspect using AopProxyService Let's say after each call to `$A->foo()` you'd like to fire off a call to `$B->bar()`, the following in your composer.yml should do the trick:

```
Injector:
  'eventMediator\EventMediator':
    properties:
      events:
        foo:
          triggerBar:
            class: B
            method: bar
  ProxiedA:
    class: A
  A:
    class: AopProxyService
    properties:
      proxied: %$ProxiedA
      afterCall:
        foo:
          - %$eventMediator\EventMediator'
```

All parameters from `$A->foo()` are sent through `$B->foo()` for your perusal.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9717cc5aaeaf534cbead15e8a28f3e74d14e12c708b1a633c7502c433b2ad397?d=identicon)[fspringveldt](/maintainers/fspringveldt)

---

Top Contributors

[![fspringveldt](https://avatars.githubusercontent.com/u/10938392?v=4)](https://github.com/fspringveldt "fspringveldt (9 commits)")

### Embed Badge

![Health badge](/badges/fspringveldt-silverstripe-event-mediator/health.svg)

```
[![Health](https://phpackages.com/badges/fspringveldt-silverstripe-event-mediator/health.svg)](https://phpackages.com/packages/fspringveldt-silverstripe-event-mediator)
```

PHPackages © 2026

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