An open API service indexing awesome lists of open source software.

https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.
https://github.com/andreas-glaser/dc-event-bundle

doctrine doctrine-orm event-handlers

Last synced: 3 months ago
JSON representation

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

Awesome Lists containing this project

README

          

# DCEventBundle - Doctrine Custom Event Bundle

This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

## Installation
```bash
composer require andreas-glaser/dc-event-bundle ^1
```

## Usage

### 1.) Attach entity event listener
```php
id;
}

/**
* Set subject
*
* @param string $subject
*
* @return Article
*/
public function setSubject($subject)
{
$this->subject = $subject;

return $this;
}

/**
* Get subject
*
* @return string
*/
public function getSubject()
{
return $this->subject;
}

/**
* Set body
*
* @param string $body
*
* @return Article
*/
public function setBody($body)
{
$this->body = $body;

return $this;
}

/**
* Get body
*
* @return string
*/
public function getBody()
{
return $this->body;
}
}
```

### 2.) Create entity event handler
```php