Commit 6c1690d3 authored by romanb's avatar romanb

[2.0] Merged PreInsertEventArgs/PreUpdateEventArgs => PreInsertUpdateEventArgs...

[2.0] Merged PreInsertEventArgs/PreUpdateEventArgs => PreInsertUpdateEventArgs since they were identical.
parent 35aa9a48
......@@ -5,12 +5,12 @@ namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs;
/**
* Class that holds event arguments for a preInsert event.
* Class that holds event arguments for a preInsert/preUpdate event.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class PreInsertEventArgs extends EventArgs
class PreInsertUpdateEventArgs extends EventArgs
{
private $_entity;
private $_entityChangeSet;
......@@ -30,10 +30,5 @@ class PreInsertEventArgs extends EventArgs
{
return $this->_entityChangeSet;
}
/*public function getEntityId()
{
}*/
}
<?php
namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs;
/**
* Class that holds event arguments for a preUpdate event.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class PreUpdateEventArgs extends EventArgs
{
private $_entity;
private $_entityChangeSet;
public function __construct($entity, array $changeSet)
{
$this->_entity = $entity;
$this->_entityChangeSet = $changeSet;
}
public function getEntity()
{
return $this->_entity;
}
public function getEntityChangeSet()
{
return $this->_entityState;
}
}
......@@ -423,7 +423,7 @@ class StandardEntityPersister
*/
final protected function _preInsert($entity)
{
$eventArgs = new \Doctrine\ORM\Event\PreInsertEventArgs(
$eventArgs = new \Doctrine\ORM\Event\PreInsertUpdateEventArgs(
$entity, $this->_em->getUnitOfWork()->getEntityChangeSet($entity)
);
$this->_evm->dispatchEvent(Events::preInsert, $eventArgs);
......@@ -446,7 +446,7 @@ class StandardEntityPersister
*/
final protected function _preUpdate($entity)
{
$eventArgs = new \Doctrine\ORM\Event\PreUpdateEventArgs(
$eventArgs = new \Doctrine\ORM\Event\PreInsertUpdateEventArgs(
$entity, $this->_em->getUnitOfWork()->getEntityChangeSet($entity)
);
$this->_evm->dispatchEvent(Events::preUpdate, $eventArgs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment