2017 © Pedro Peláez
 

contao-module contao-model-events

image

richardhj/contao-model-events

  • Thursday, February 1, 2018
  • by richardhj
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 50 % Grown

The README.md

Contao Model Events

Latest Version on Packagist ![Software License][ico-license], (*1)

This extension provides the DispatchModelEventsTrait that makes the following events available for your custom model:, (*2)

Events implemented

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., (*3)

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

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., (*5)

DeleteModelEvent

Triggered after the model has been deleted successfully. You can access the Model instance., (*6)

Usage

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., (*7)

The Versions

01/02 2018

v1.1.x-dev

1.1.9999999.9999999-dev

  Sources   Download

LGPL-3.0-or-later

The Requires

 

contao

01/02 2018

v1.1.0

1.1.0.0

  Sources   Download

LGPL-3.0-or-later

The Requires

 

contao

26/12 2017

v2.0.x-dev

2.0.9999999.9999999-dev

  Sources   Download

LGPL-3.0+

The Requires

 

contao