Permalink
Browse files

Merge pull request #569 from Ocramius/hotfix/pre-flush-event-args-params

Hotfix/pre flush event args params
  • Loading branch information...
2 parents 39374b7 + f281dbb commit 719031f2effd2074d94c709b6b7311fb0773fb7f @FabioBatSilva FabioBatSilva committed Feb 12, 2013
@@ -19,6 +19,8 @@
namespace Doctrine\ORM\Event;
+use Doctrine\ORM\EntityManager;
+
/**
* Provides event arguments for the onClear event.
*
@@ -46,7 +48,7 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
* @param \Doctrine\ORM\EntityManager $em
* @param string|null $entityClass Optional entity class.
*/
- public function __construct($em, $entityClass = null)
+ public function __construct(EntityManager $em, $entityClass = null)
{
$this->em = $em;
$this->entityClass = $entityClass;
@@ -19,6 +19,7 @@
namespace Doctrine\ORM\Event;
+use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager;
/**
@@ -30,7 +31,7 @@
* @author Roman Borschel <roman@code-factory.de>
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
-class OnFlushEventArgs extends \Doctrine\Common\EventArgs
+class OnFlushEventArgs extends EventArgs
{
/**
* @var \Doctrine\ORM\EntityManager
@@ -19,6 +19,9 @@
namespace Doctrine\ORM\Event;
+use Doctrine\Common\EventArgs;
+use Doctrine\ORM\EntityManager;
+
/**
* Provides event arguments for the preFlush event.
*
@@ -28,28 +31,28 @@
* @author Roman Borschel <roman@code-factory.de>
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
-class PreFlushEventArgs extends \Doctrine\Common\EventArgs
+class PreFlushEventArgs extends EventArgs
{
/**
* @var \Doctrine\ORM\EntityManager
*/
- private $_em;
+ private $em;
/**
* Constructor.
*
* @param \Doctrine\ORM\EntityManager $em
*/
- public function __construct($em)
+ public function __construct(EntityManager $em)
{
- $this->_em = $em;
+ $this->em = $em;
}
/**
* @return \Doctrine\ORM\EntityManager
*/
public function getEntityManager()
{
- return $this->_em;
+ return $this->em;
}
}
@@ -524,7 +524,7 @@ public function computeChangeSet(ClassMetadata $class, $entity)
$invoke = $this->listenersInvoker->getSubscribedSystems($class, Events::preFlush);
if ($invoke !== ListenersInvoker::INVOKE_NONE) {
- $this->listenersInvoker->invoke($class, Events::preFlush, $entity, new PreFlushEventArgs($entity, $this->em), $invoke);
+ $this->listenersInvoker->invoke($class, Events::preFlush, $entity, new PreFlushEventArgs($this->em), $invoke);
}
$actualData = array();

0 comments on commit 719031f

Please sign in to comment.