Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steevanb/doctrine-events
Add events to Doctrine
https://github.com/steevanb/doctrine-events
doctrine php symfony
Last synced: 9 days ago
JSON representation
Add events to Doctrine
- Host: GitHub
- URL: https://github.com/steevanb/doctrine-events
- Owner: steevanb
- Created: 2016-12-12T14:33:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T07:11:08.000Z (over 7 years ago)
- Last Synced: 2024-11-24T16:05:06.770Z (29 days ago)
- Topics: doctrine, php, symfony
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
Awesome Lists containing this project
README
[![version](https://img.shields.io/badge/version-1.2.0-green.svg)](https://github.com/steevanb/doctrine-events/tree/1.2.0)
[![doctrine](https://img.shields.io/badge/doctrine/orm-^2.5.0-blue.svg)](http://www.doctrine-project.org)
[![php](https://img.shields.io/badge/php-^5.4.6%20||%20^7.0-blue.svg)](http://www.php.net)
![Lines](https://img.shields.io/badge/code%20lines-1512-green.svg)
![Total Downloads](https://poser.pugx.org/steevanb/doctrine-events/downloads)
[![SensionLabsInsight](https://img.shields.io/badge/SensionLabsInsight-platinum-brightgreen.svg)](https://insight.sensiolabs.com/projects/c0ecb586-f4b3-472d-8202-e2e2a6a2f474/analyses/8)
[![Scrutinizer](https://scrutinizer-ci.com/g/steevanb/doctrine-events/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/steevanb/doctrine-events/)doctrine-events
---------------Add some events to Doctrine 2.5
Fix a Doctrine UnitOfwork bug with extraUpdates, who are not removed when you add and remove your entity before calling flush()
[Changelog](changelog.md)
onCreateEntityOverrideLocalValues
---------------------------------Dispatched when UnitOfWork try to know if current entity must be filled with values retrieved from query,
or if this entity is already known and fields are already defined.onCreateEntityDefineFieldValues
-------------------------------Dispactched when UnitOfWork define entity field values
onNewEntityInstance
-------------------Dispactched when UnitOfWork create new instance of your Entity
Installation
------------Add it to your composer.json :
```yml
{
"require": {
"steevanb/doctrine-events": "^1.2",
}
}
```You have to use steevanb\DoctrineEvents\Doctrine\ORM\EntityManager instead of Doctrine\ORM\EntityManager
Internally, it will use steevanb\DoctrineEvents\Doctrine\ORM\UnitOfWork instead of Doctrine\ORM\UnitOfWork
If you are on Symfony2 or Symfony3 project, you can add it to your config :
```yml
# app/config.yml
parameters:
doctrine.orm.entity_manager.class: steevanb\DoctrineEvents\Doctrine\ORM\EntityManager
```Some lib who use it
-------------------[https://github.com/steevanb/doctrine-entity-merger](https://github.com/steevanb/doctrine-entity-merger) : add MERGE_ENTITY hint
to define fields loaded with multiple queries, with PARTIAL, instead of returning first hydrated entity