|
@@ 680-682 (lines=3) @@
|
677 |
|
} |
678 |
|
|
679 |
|
// Fire PreFlush lifecycle callbacks |
680 |
|
if ( ! empty($class->lifecycleCallbacks[Events::preFlush])) { |
681 |
|
$class->invokeLifecycleCallbacks(Events::preFlush, $document, array(new Event\PreFlushEventArgs($this->dm))); |
682 |
|
} |
683 |
|
|
684 |
|
$this->computeOrRecomputeChangeSet($class, $document); |
685 |
|
} |
|
@@ 1062-1064 (lines=3) @@
|
1059 |
|
private function persistNew(ClassMetadata $class, $document) |
1060 |
|
{ |
1061 |
|
$oid = spl_object_hash($document); |
1062 |
|
if ( ! empty($class->lifecycleCallbacks[Events::prePersist])) { |
1063 |
|
$class->invokeLifecycleCallbacks(Events::prePersist, $document, array(new LifecycleEventArgs($document, $this->dm))); |
1064 |
|
} |
1065 |
|
if ($this->evm->hasListeners(Events::prePersist)) { |
1066 |
|
$this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($document, $this->dm)); |
1067 |
|
} |
|
@@ 1142-1144 (lines=3) @@
|
1139 |
|
$embeddedClass = $this->dm->getClassMetadata(get_class($embeddedDocument)); |
1140 |
|
} |
1141 |
|
|
1142 |
|
if ( ! empty($embeddedClass->lifecycleCallbacks[Events::postPersist])) { |
1143 |
|
$embeddedClass->invokeLifecycleCallbacks(Events::postPersist, $embeddedDocument, array(new LifecycleEventArgs($document, $this->dm))); |
1144 |
|
} |
1145 |
|
if ($hasPostPersistListeners) { |
1146 |
|
$this->evm->dispatchEvent(Events::postPersist, new LifecycleEventArgs($embeddedDocument, $this->dm)); |
1147 |
|
} |
|
@@ 1357-1361 (lines=5) @@
|
1354 |
|
} |
1355 |
|
|
1356 |
|
if (isset($this->documentInsertions[$entryOid])) { |
1357 |
|
if ( ! empty($entryClass->lifecycleCallbacks[Events::postPersist])) { |
1358 |
|
$entryClass->invokeLifecycleCallbacks(Events::postPersist, $entry, array( |
1359 |
|
new LifecycleEventArgs($entry, $this->dm) |
1360 |
|
)); |
1361 |
|
} |
1362 |
|
if ($hasPostPersistListeners) { |
1363 |
|
$this->evm->dispatchEvent(Events::postPersist, new LifecycleEventArgs($entry, $this->dm)); |
1364 |
|
} |
|
@@ 1366-1370 (lines=5) @@
|
1363 |
|
$this->evm->dispatchEvent(Events::postPersist, new LifecycleEventArgs($entry, $this->dm)); |
1364 |
|
} |
1365 |
|
} else { |
1366 |
|
if ( ! empty($entryClass->lifecycleCallbacks[Events::postUpdate])) { |
1367 |
|
$entryClass->invokeLifecycleCallbacks(Events::postUpdate, $entry, array( |
1368 |
|
new LifecycleEventArgs($entry, $this->dm) |
1369 |
|
)); |
1370 |
|
} |
1371 |
|
if ($hasPostUpdateListeners) { |
1372 |
|
$this->evm->dispatchEvent(Events::postUpdate, new LifecycleEventArgs($entry, $this->dm)); |
1373 |
|
} |
|
@@ 1961-1963 (lines=3) @@
|
1958 |
|
// nothing to do |
1959 |
|
break; |
1960 |
|
case self::STATE_MANAGED: |
1961 |
|
if ( ! empty($class->lifecycleCallbacks[Events::preRemove])) { |
1962 |
|
$class->invokeLifecycleCallbacks(Events::preRemove, $document, array(new LifecycleEventArgs($document, $this->dm))); |
1963 |
|
} |
1964 |
|
if ($this->evm->hasListeners(Events::preRemove)) { |
1965 |
|
$this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($document, $this->dm)); |
1966 |
|
} |