Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

DDC-2173 - Correct issue is about "postFlush" not "preFlush" and add …

…test
  • Loading branch information...
commit 0b2d3d4f5d41c56fa07ff8d7ada406ec8bb34046 1 parent c20cfed
@beberlei beberlei authored
View
4 UPGRADE.md
@@ -1,8 +1,8 @@
# Upgrade to 2.4
-## OnFlush and PreFlush event always called
+## OnFlush and PostFlush event always called
-Before 2.4 the preFlush and onFlush events were only called when there were
+Before 2.4 the postFlush and onFlush events were only called when there were
actually entities that changed. Now these events are called no matter if there
are entities in the UoW or changes are found.
View
8 tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php
@@ -57,6 +57,7 @@ public function testPreAndOnFlushCalledAlways()
$listener = new OnFlushCalledListener();
$this->_em->getEventManager()->addEventListener(Events::onFlush, $listener);
$this->_em->getEventManager()->addEventListener(Events::preFlush, $listener);
+ $this->_em->getEventManager()->addEventListener(Events::postFlush, $listener);
$this->_em->flush();
@@ -115,6 +116,7 @@ class OnFlushCalledListener
{
public $preFlush = 0;
public $onFlush = 0;
+ public $postFlush = 0;
public function preFlush($args)
{
@@ -125,4 +127,10 @@ public function onFlush($args)
{
$this->onFlush++;
}
+
+ public function postFlush($args)
+ {
+ $this->postFlush++;
+ }
}
+
Please sign in to comment.
Something went wrong with that request. Please try again.