https://github.com/bpolaszek/doctrine-watcher-bundle
Symfony Bundle for bentools/doctrine-watcher
https://github.com/bpolaszek/doctrine-watcher-bundle
Last synced: 10 months ago
JSON representation
Symfony Bundle for bentools/doctrine-watcher
- Host: GitHub
- URL: https://github.com/bpolaszek/doctrine-watcher-bundle
- Owner: bpolaszek
- License: mit
- Created: 2018-11-23T14:02:35.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T16:53:50.000Z (almost 7 years ago)
- Last Synced: 2025-01-10T09:59:38.689Z (12 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Doctrine Watcher Bundle
A Symfony bundle for [bentools/doctrine-watcher](https://github.com/bpolaszek/doctrine-watcher).
## Installation
```bash
composer require bentools/doctrine-watcher-bundle:1.0.x-dev
```
## Configuration
There are 2 ways to configure the bundle:
### Via bundle configuration
```yaml
# app/config/config.yml or config/packages/doctrine_watcher.yaml with Symfony Flex
doctrine_watcher:
watch:
App\Entity\Book:
properties:
title:
callback: 'App\Services\BookWatcher::onTitleChange'
reviews:
callback: 'App\Services\BookWatcher::onReviewsChange'
iterable: true
```
### Via service tags
```yaml
# app/config/services.yml or config/services.yaml with Symfony Flex
services:
App\Services\BookWatcher:
tags:
- { name: bentools.doctrine_watcher, entity_class: App\Entity\Book, property: 'title', method: 'onTitleChange' }
- { name: bentools.doctrine_watcher, entity_class: App\Entity\Book, property: 'reviews', method: 'onReviewsChange', iterable: true }
```
## License
MIT.