PHPackages                             richardhj/contao-model-events - 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. richardhj/contao-model-events

ActiveContao-module[Utility &amp; Helpers](/categories/utility)

richardhj/contao-model-events
=============================

v1.2.1(6y ago)0252LGPL-3.0-or-laterPHPPHP ^7.1

Since Jan 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/richardhj/contao-model-events)[ Packagist](https://packagist.org/packages/richardhj/contao-model-events)[ RSS](/packages/richardhj-contao-model-events/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Contao Model Events
===================

[](#contao-model-events)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bc1aba95181a4e6ac1b6c1b95c716731ea876ad6d2fbd2c5f0e1a98664b90372/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696368617264686a2f636f6e74616f2d6d6f64656c2d6576656e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/richardhj/contao-model-events)![Software License](https://camo.githubusercontent.com/2bc95db9d4d6b319fe40fe1a46431a18f9684b30d516775115c5d0df6aa3e9b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4c47504c2d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)

This extension provides the `DispatchModelEventsTrait` that makes the following events available for your custom model:

Events implemented
------------------

[](#events-implemented)

### PrePersistModelEvent

[](#prepersistmodelevent)

Triggered before persisting the model in the database. You can access the `Model` with the current data and the `Model` with the original data.

Row data can be modified at this point, when using `setData()`.

### PostPersistModelEvent

[](#postpersistmodelevent)

Triggered after persisting the model in the database. You can access the `Model` with the current data and the `Model` with the original data.

### DeleteModelEvent

[](#deletemodelevent)

Triggered after the model has been deleted successfully. You can access the `Model` instance.

Usage
-----

[](#usage)

### Implement the Trait in your custom model

[](#implement-the-trait-in-your-custom-model)

```
use Contao\Model;

class MyTableModel extends Model
{

    use Contao\Model\DispatchModelEventsTrait;

    /**
     * Table name
     *
     * @var string
     */
    protected static $strTable = 'tl_my_table';
}
```

From now on, the above mentioned events get triggered on any `save()` and `delete()` action.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~345 days

Total

4

Last Release

2423d ago

PHP version history (2 changes)v1.0.0PHP ^5.4 || ^7.0

v1.2.0PHP ^7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1284725?v=4)[Richard Henkenjohann](/maintainers/richardhj)[@richardhj](https://github.com/richardhj)

---

Top Contributors

[![richardhj](https://avatars.githubusercontent.com/u/1284725?v=4)](https://github.com/richardhj "richardhj (12 commits)")

---

Tags

contao

### Embed Badge

![Health badge](/badges/richardhj-contao-model-events/health.svg)

```
[![Health](https://phpackages.com/badges/richardhj-contao-model-events/health.svg)](https://phpackages.com/packages/richardhj-contao-model-events)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

41668.4k163](/packages/codefog-contao-haste)[metamodels/core

MetaModels core

9956.1k68](/packages/metamodels-core)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3187.0k6](/packages/codefog-contao-news-categories)[contao-community-alliance/dc-general

Universal data container for Contao

1579.5k90](/packages/contao-community-alliance-dc-general)[oveleon/contao-component-style-manager

Style and CSS-Class Manager for Contao Open Source CMS

2337.6k8](/packages/oveleon-contao-component-style-manager)[terminal42/contao-folderpage

Provides a new page type for Contao that allows you to group pages into folders.

18153.4k10](/packages/terminal42-contao-folderpage)

PHPackages © 2026

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