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.
- Host: GitHub
- URL: https://github.com/andreas-glaser/dc-event-bundle
- Owner: andreas-glaser
- License: mit
- Archived: true
- Created: 2015-09-21T06:08:45.000Z (over 10 years ago)
- Default Branch: 1.2
- Last Pushed: 2018-12-07T05:35:18.000Z (over 7 years ago)
- Last Synced: 2025-05-29T18:57:12.454Z (10 months ago)
- Topics: doctrine, doctrine-orm, event-handlers
- Language: PHP
- Homepage: https://github.com/andreas-glaser/dc-event-bundle/
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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