[2.0] Merged PreInsertEventArgs/PreUpdateEventArgs => PreInsertUpdateEventArgs since they were identical.
This commit is contained in:
parent
35aa9a4850
commit
6c1690d352
@ -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()
|
||||
{
|
||||
|
||||
}*/
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
<?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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user