@@ 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 | /** |
@@ 1032-1034 (lines=3) @@ | ||
1029 | if ( ! empty($class->lifecycleCallbacks[Events::prePersist])) { |
|
1030 | $class->invokeLifecycleCallbacks(Events::prePersist, $document); |
|
1031 | } |
|
1032 | if ($this->evm->hasListeners(Events::prePersist)) { |
|
1033 | $this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($document, $this->dm)); |
|
1034 | } |
|
1035 | ||
1036 | $upsert = false; |
|
1037 | if ($class->identifier) { |
|
@@ 1940-1942 (lines=3) @@ | ||
1937 | if ( ! empty($class->lifecycleCallbacks[Events::preRemove])) { |
|
1938 | $class->invokeLifecycleCallbacks(Events::preRemove, $document); |
|
1939 | } |
|
1940 | if ($this->evm->hasListeners(Events::preRemove)) { |
|
1941 | $this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($document, $this->dm)); |
|
1942 | } |
|
1943 | $this->scheduleForDelete($document); |
|
1944 | break; |
|
1945 | case self::STATE_DETACHED: |
|
@@ 2510-2512 (lines=3) @@ | ||
2507 | } |
|
2508 | } |
|
2509 | ||
2510 | if ($this->evm->hasListeners(Events::onClear)) { |
|
2511 | $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName)); |
|
2512 | } |
|
2513 | } |
|
2514 | ||
2515 | /** |