@@ 437-439 (lines=3) @@ | ||
434 | $args = array(&$data); |
|
435 | $metadata->invokeLifecycleCallbacks(Events::preLoad, $document, $args); |
|
436 | } |
|
437 | if ($this->evm->hasListeners(Events::preLoad)) { |
|
438 | $this->evm->dispatchEvent(Events::preLoad, new PreLoadEventArgs($document, $this->dm, $data)); |
|
439 | } |
|
440 | ||
441 | // alsoLoadMethods may transform the document before hydration |
|
442 | if ( ! empty($metadata->alsoLoadMethods)) { |
|
@@ 463-465 (lines=3) @@ | ||
460 | if ( ! empty($metadata->lifecycleCallbacks[Events::postLoad])) { |
|
461 | $metadata->invokeLifecycleCallbacks(Events::postLoad, $document); |
|
462 | } |
|
463 | if ($this->evm->hasListeners(Events::postLoad)) { |
|
464 | $this->evm->dispatchEvent(Events::postLoad, new LifecycleEventArgs($document, $this->dm)); |
|
465 | } |
|
466 | ||
467 | return $data; |
|
468 | } |
@@ 183-186 (lines=4) @@ | ||
180 | ||
181 | $class->setParentClasses($nonSuperclassParents); |
|
182 | ||
183 | if ($this->evm->hasListeners(Events::loadClassMetadata)) { |
|
184 | $eventArgs = new \Doctrine\ODM\MongoDB\Event\LoadClassMetadataEventArgs($class, $this->dm); |
|
185 | $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs); |
|
186 | } |
|
187 | } |
|
188 | ||
189 | /** |
@@ 1033-1035 (lines=3) @@ | ||
1030 | if ( ! empty($class->lifecycleCallbacks[Events::prePersist])) { |
|
1031 | $class->invokeLifecycleCallbacks(Events::prePersist, $document); |
|
1032 | } |
|
1033 | if ($this->evm->hasListeners(Events::prePersist)) { |
|
1034 | $this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($document, $this->dm)); |
|
1035 | } |
|
1036 | ||
1037 | $upsert = false; |
|
1038 | if ($class->identifier) { |
|
@@ 1926-1928 (lines=3) @@ | ||
1923 | if ( ! empty($class->lifecycleCallbacks[Events::preRemove])) { |
|
1924 | $class->invokeLifecycleCallbacks(Events::preRemove, $document); |
|
1925 | } |
|
1926 | if ($this->evm->hasListeners(Events::preRemove)) { |
|
1927 | $this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($document, $this->dm)); |
|
1928 | } |
|
1929 | $this->scheduleForDelete($document); |
|
1930 | break; |
|
1931 | case self::STATE_DETACHED: |
|
@@ 2496-2498 (lines=3) @@ | ||
2493 | } |
|
2494 | } |
|
2495 | ||
2496 | if ($this->evm->hasListeners(Events::onClear)) { |
|
2497 | $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName)); |
|
2498 | } |
|
2499 | } |
|
2500 | ||
2501 | /** |