1
0
mirror of synced 2025-01-30 20:11:49 +03:00

[2.0] Merged PreInsertEventArgs/PreUpdateEventArgs => PreInsertUpdateEventArgs since they were identical.

This commit is contained in:
romanb 2009-07-15 17:18:26 +00:00
parent 35aa9a4850
commit 6c1690d352
3 changed files with 4 additions and 43 deletions

View File

@ -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()
{
}*/
}

View File

@ -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;
}
}

View File

@ -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);